lib/daylight/refinements.rb
# Define scopes that the class can be refined by
Define scopes that the class can be refined by
Define scopes that the class can be refined by
def scopes *names
      self.scope_names ||= []
      names.each do |scope|
        self.scope_names << scope
        define_singleton_method scope do
          resource_proxy.append_scope(scope)
        end
        resource_proxy_class.send(:define_method, scope) do
          append_scope(scope)
        end
      end
    end
def scopes * names self . scope_names ||= [ ] names . each do | scope | self . scope_names << scope define_singleton_method scope do resource_proxy . append_scope ( scope ) end resource_proxy_class . send ( :define_method , scope ) do append_scope ( scope ) end end end
Define scopes that the class can be refined by
Define scopes that the class can be refined by
# hand chaining duties off to the ResourceProxy instance # ResourceProxy instance also needs to respond to scopes # self.scope_names.freeze
names
<not_specific>