Module: Spyke::Scoping::ClassMethods

Defined in:
lib/spyke/scoping.rb

Instance Method Summary collapse

Instance Method Details

#allObject



12
13
14
# File 'lib/spyke/scoping.rb', line 12

def all
  current_scope || Relation.new(self, uri: uri)
end

#current_scopeObject



24
25
26
# File 'lib/spyke/scoping.rb', line 24

def current_scope
  ScopeRegistry.value_for(:current_scope, name)
end

#current_scope=(scope) ⇒ Object



20
21
22
# File 'lib/spyke/scoping.rb', line 20

def current_scope=(scope)
  ScopeRegistry.set_value_for(:current_scope, name, scope)
end

#scope(name, code) ⇒ Object



16
17
18
# File 'lib/spyke/scoping.rb', line 16

def scope(name, code)
  define_singleton_method name, code
end