Class: ACTV::Identity
Direct Known Subclasses
Asset, AssetDescriptionType, AssetStatus, Channel, Interest, Organizer, PopularInterest, Tag, User
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #id ⇒ Integer
-
#initialize(attrs = {}) ⇒ ACTV::Base
constructor
Initializes a new object.
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, #delete, from_response, #memoize, #method_missing, object_attr_reader, #respond_to?, #to_hash, #update, uri_attr_reader
Constructor Details
#initialize(attrs = {}) ⇒ ACTV::Base
Initializes a new object
11 12 13 14 |
# File 'lib/actv/identity.rb', line 11 def initialize(attrs={}) super raise ArgumentError, 'argument must have an :id key' unless id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ACTV::Base
Instance Method Details
#==(other) ⇒ Boolean
18 19 20 |
# File 'lib/actv/identity.rb', line 18 def ==(other) super || attr_equal(:id, other) || attrs_equal(other) end |
#id ⇒ Integer
23 24 25 |
# File 'lib/actv/identity.rb', line 23 def id @attrs[:id] end |