Class: Furud::Node

Inherits:
Data
  • Object
show all
Defined in:
lib/furud/types.rb,
sig/furud.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value: nil, children: []) ⇒ Node

Returns a new instance of Node.

Parameters:

  • type: (Symbol)
  • value: (Object) (defaults to: nil)
  • children: (Array[Node]) (defaults to: [])


41
42
43
# File 'lib/furud/types.rb', line 41

def initialize(type:, value: nil, children: [])
  super(type: type.to_sym, value: value, children: children.freeze)
end

Instance Attribute Details

#children ⇒ Object (readonly)

Returns the value of attribute children

Returns:

  • (Object) —

    the current value of children



40
41
42
# File 'lib/furud/types.rb', line 40

def children
  @children
end

#type ⇒ Object (readonly)

Returns the value of attribute type

Returns:

  • (Object) —

    the current value of type



40
41
42
# File 'lib/furud/types.rb', line 40

def type
  @type
end

#value ⇒ Object (readonly)

Returns the value of attribute value

Returns:

  • (Object) —

    the current value of value



40
41
42
# File 'lib/furud/types.rb', line 40

def value
  @value
end