Sha256: d8ad1d92ff387aedc4c6b328bc6c2a420743526b1d8e84ee496395750c82f35f

Contents?: true

Size: 774 Bytes

Versions: 1

Compression:

Stored size: 774 Bytes

Contents

module CassandraObject
  class Scope
    module QueryMethods
      def select!(*values)
        self.select_values += values.flatten
        self
      end

      def select(*values, &block)
        if block_given?
          to_a.select(&block)
        else
          clone.select! *values
        end
      end

      def where!(*values)
        self.where_values += values.flatten
        self
      end

      def where(*values)
        clone.where! values
      end

      def limit!(value)
        self.limit_value = value
        self
      end

      def limit(value)
        clone.limit! value
      end

      def to_cql
        adapter.build_query(self)
      end

      def to_a
        instantiate_from_cql(adapter.build_query(self))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.11.6 lib/cassandra_object/scope/query_methods.rb