Class: Havox::Node
- Inherits:
-
Object
- Object
- Havox::Node
- Defined in:
- lib/havox/classes/node.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #host? ⇒ Boolean
-
#initialize(name, attributes) ⇒ Node
constructor
A new instance of Node.
- #switch? ⇒ Boolean
Constructor Details
#initialize(name, attributes) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 |
# File 'lib/havox/classes/node.rb', line 5 def initialize(name, attributes) @name = name @type = attributes[:type]&.to_sym @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/havox/classes/node.rb', line 3 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/havox/classes/node.rb', line 3 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/havox/classes/node.rb', line 3 def type @type end |
Instance Method Details
#host? ⇒ Boolean
11 12 13 |
# File 'lib/havox/classes/node.rb', line 11 def host? @type.eql?(:host) end |
#switch? ⇒ Boolean
15 16 17 |
# File 'lib/havox/classes/node.rb', line 15 def switch? @type.eql?(:switch) end |