Module: ActiveRemote::ScopeKeys
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#scope_key_hash ⇒ Object
Instance level hash of scope keys and their corresponding values.
-
#scope_keys ⇒ Object
Instance level access to the scope key of the current class.
Instance Method Details
#scope_key_hash ⇒ Object
Instance level hash of scope keys and their corresponding values. For instance,
class Tag < ActiveRemote::Base
scope_key :user_guid
end
would return this hash:
:guid => tag[:guid],
:user_guid => tag[:user_guid]
This hash is used when accessing or modifying a remote object like when calling #update in the persistence module, for example.
61 62 63 |
# File 'lib/active_remote/scope_keys.rb', line 61 def scope_key_hash attributes.slice(*scope_keys) end |
#scope_keys ⇒ Object
Instance level access to the scope key of the current class
40 41 42 |
# File 'lib/active_remote/scope_keys.rb', line 40 def scope_keys @scope_keys ||= self.class.scope_keys end |