Class: Subjoin::Identifier
- Inherits:
-
Object
- Object
- Subjoin::Identifier
- Includes:
- Metable
- Defined in:
- lib/subjoin/identifier.rb
Overview
A resource identifier object
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes included from Metable
Instance Method Summary collapse
-
#==(other) ⇒ Object
Test for equality.
-
#initialize(type, id, meta = nil) ⇒ Identifier
constructor
A new instance of Identifier.
Methods included from Metable
Constructor Details
#initialize(type, id, meta = nil) ⇒ Identifier
Returns a new instance of Identifier.
10 11 12 13 14 15 |
# File 'lib/subjoin/identifier.rb', line 10 def initialize(type, id, =nil) #load_key(data) @type = type @id = id = () end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/subjoin/identifier.rb', line 8 def id @id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/subjoin/identifier.rb', line 7 def type @type end |
Instance Method Details
#==(other) ⇒ Object
Test for equality. Two Ideintifers are considered equal if they have the same type and id
19 20 21 |
# File 'lib/subjoin/identifier.rb', line 19 def ==(other) return @type == other.type && @id == other.id end |