Class: Grumlin::VertexProperty
- Inherits:
-
Object
- Object
- Grumlin::VertexProperty
- Defined in:
- lib/grumlin/vertex_property.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ VertexProperty
constructor
A new instance of VertexProperty.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ VertexProperty
Returns a new instance of VertexProperty.
6 7 8 9 |
# File 'lib/grumlin/vertex_property.rb', line 6 def initialize(value) @label = value[:label] @value = Grumlin::Typing.cast(value[:value]) end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/grumlin/vertex_property.rb', line 4 def label @label end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/grumlin/vertex_property.rb', line 4 def value @value end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/grumlin/vertex_property.rb', line 19 def ==(other) self.class == other.class && @label == other.label && @value == other.value end |
#inspect ⇒ Object
11 12 13 |
# File 'lib/grumlin/vertex_property.rb', line 11 def inspect "vp[#{label}->#{value}]" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/grumlin/vertex_property.rb', line 15 def to_s inspect end |