Class: Halibut::LinkRelation
- Inherits:
-
Object
- Object
- Halibut::LinkRelation
- Defined in:
- lib/halibut/link_relation.rb
Overview
Domain object that represents a Relation
spec spec spec.
Instance Attribute Summary collapse
-
#curie ⇒ Object
Returns the value of attribute curie.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name) ⇒ LinkRelation
constructor
A new instance of LinkRelation.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ LinkRelation
Returns a new instance of LinkRelation.
9 10 11 12 13 |
# File 'lib/halibut/link_relation.rb', line 9 def initialize(name) splits = name.to_s.split(":") splits.size < 2 ? @name = splits.first : (@curie, @name = splits) end |
Instance Attribute Details
#curie ⇒ Object
Returns the value of attribute curie.
7 8 9 |
# File 'lib/halibut/link_relation.rb', line 7 def curie @curie end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/halibut/link_relation.rb', line 7 def name @name end |
Instance Method Details
#eql?(other) ⇒ Boolean
15 16 17 |
# File 'lib/halibut/link_relation.rb', line 15 def eql?(other) hash == other.hash end |
#hash ⇒ Object
19 20 21 |
# File 'lib/halibut/link_relation.rb', line 19 def hash instance_variables.hash end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/halibut/link_relation.rb', line 23 def to_s @curie and "#{@curie}:#{@name}" or @name end |