Sha256: 33540c89fb9f215a23d62514f629ddbb217040d8c37eea4c579a66555687de03

Contents?: true

Size: 344 Bytes

Versions: 4

Compression:

Stored size: 344 Bytes

Contents

module CloudSesame
	module Query
		module DSL
			module ScopeMethods

				def scopes
				  dsl_context[:scopes]
				end

				private

				def method_missing(name, *args, &block)
					if scopes && (callback = scopes[name])
						self.instance_exec *args, &callback
					  dsl_return
					else
						super
					end
				end

			end
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
CloudSesame-0.2.3 lib/cloud_sesame/query/dsl/scope_methods.rb
CloudSesame-0.2.2 lib/cloud_sesame/query/dsl/scope_methods.rb
CloudSesame-0.2.1 lib/cloud_sesame/query/dsl/scope_methods.rb
CloudSesame-0.2.0 lib/cloud_sesame/query/dsl/scope_methods.rb