Class: Mementus::Node
- Inherits:
-
Object
- Object
- Mementus::Node
- Defined in:
- lib/mementus/node.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
Instance Method Summary collapse
- #[](prop) ⇒ Object
-
#initialize(id: nil, label: nil, props: {}) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(id: nil, label: nil, props: {}) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 |
# File 'lib/mementus/node.rb', line 5 def initialize(id: nil, label: nil, props: {}) @id = id @label = label @props = props.freeze end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/mementus/node.rb', line 3 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/mementus/node.rb', line 3 def label @label end |
#props ⇒ Object (readonly)
Returns the value of attribute props.
3 4 5 |
# File 'lib/mementus/node.rb', line 3 def props @props end |
Instance Method Details
#[](prop) ⇒ Object
11 12 13 |
# File 'lib/mementus/node.rb', line 11 def [](prop) @props[prop] end |