Class: Unit::Types::Relationship
- Inherits:
-
Object
- Object
- Unit::Types::Relationship
- Defined in:
- lib/unit/types/relationship.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, id) ⇒ Relationship
constructor
A new instance of Relationship.
- #to_hash ⇒ Object
Constructor Details
#initialize(type, id) ⇒ Relationship
Returns a new instance of Relationship.
11 12 13 14 |
# File 'lib/unit/types/relationship.rb', line 11 def initialize(type, id) @type = type @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/unit/types/relationship.rb', line 7 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/unit/types/relationship.rb', line 7 def type @type end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 |
# File 'lib/unit/types/relationship.rb', line 16 def to_hash { "data": { "type": type, "id": id } } end |