Class: Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/src/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNode

Returns a new instance of Node.



4
5
6
7
# File 'lib/src/node.rb', line 4

def initialize(*)
  super
  self.path ||= ""
end

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



3
4
5
# File 'lib/src/node.rb', line 3

def path
  @path
end

#propsObject

Returns the value of attribute props

Returns:

  • (Object)

    the current value of props



3
4
5
# File 'lib/src/node.rb', line 3

def props
  @props
end

Instance Method Details

#array_of_pathsObject



15
16
17
# File 'lib/src/node.rb', line 15

def array_of_paths
  array_paths(props[:array_of])
end

#first_only?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/src/node.rb', line 9

def first_only?
  return unless props.is_a? Hash

  props[:array_presence] == "first_only"
end