Sha256: bdff9da14ca59a58f3fbae2c9b8c708f48eff6cbe8b1d0eb11b4331afa3c06a9

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

module CloudSesame
	module Query
		module DSL
			module FieldMethods

				def literal(name, *values)
					name = name.to_sym
					if (fields = dsl_context[:fields]) && fields[name]
				  	dsl_scope.children.field = name
				  	dsl_scope.children.dsl_return = dsl_return
				  	dsl_scope.children.insert values
				  else
				  	false
				  end
				end

				private

				def method_missing(name, *values, &block)
				  (result = literal(name, *values)) ? result : super
				end

			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
CloudSesame-0.4.2 lib/cloud_sesame/query/dsl/field_methods.rb
CloudSesame-0.4.1 lib/cloud_sesame/query/dsl/field_methods.rb