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.



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

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

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



1
2
3
# File 'lib/src/node.rb', line 1

def path
  @path
end

#propsObject

Returns the value of attribute props

Returns:

  • (Object)

    the current value of props



1
2
3
# File 'lib/src/node.rb', line 1

def props
  @props
end

Instance Method Details

#array_of_pathsObject



13
14
15
# File 'lib/src/node.rb', line 13

def array_of_paths
  array_paths(props[:array_of])
end

#first_only?Boolean

Returns:

  • (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