Module: Stretchy::Scopes::ClassMethods

Defined in:
lib/stretchy/scopes.rb

Instance Method Summary collapse

Instance Method Details

#search(options = {}) ⇒ Object



13
14
15
# File 'lib/stretchy/scopes.rb', line 13

def search(options = {})
  stretchy_scope.new stretchy_options.merge(options)
end

#stretch(name, block) ⇒ Object



25
26
27
# File 'lib/stretchy/scopes.rb', line 25

def stretch(name, block)
  stretchy_scope.send(:define_method, name, &block)
end

#stretchify(options = {}) ⇒ Object



9
10
11
# File 'lib/stretchy/scopes.rb', line 9

def stretchify(options = {})
  @stretchy_options = options
end

#stretchy_optionsObject



17
18
19
# File 'lib/stretchy/scopes.rb', line 17

def stretchy_options
  Hash(@stretchy_options)
end

#stretchy_scopeObject



21
22
23
# File 'lib/stretchy/scopes.rb', line 21

def stretchy_scope
  @scopes_class ||= Class.new Stretchy::API
end