Class: Node
- Inherits:
-
Struct
- Object
- Struct
- Node
- Defined in:
- lib/src/node.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#props ⇒ Object
Returns the value of attribute props.
Instance Method Summary collapse
- #array_of_paths ⇒ Object
- #first_only? ⇒ Boolean
-
#initialize ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
2 3 4 5 |
# File 'lib/src/node.rb', line 2 def initialize(*) super self.path ||= "" end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path
1 2 3 |
# File 'lib/src/node.rb', line 1 def path @path end |
#props ⇒ Object
Returns the value of attribute props
1 2 3 |
# File 'lib/src/node.rb', line 1 def props @props end |
Instance Method Details
#array_of_paths ⇒ Object
13 14 15 |
# File 'lib/src/node.rb', line 13 def array_of_paths array_paths(props[:array_of]) end |
#first_only? ⇒ Boolean
7 8 9 10 11 |
# File 'lib/src/node.rb', line 7 def first_only? return unless props.is_a? Hash props[:array_presence] == "first_only" end |