Module: ActiveRemote::ScopeKeys

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_remote/scope_keys.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#scope_key_hashObject

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_keysObject

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