Class: Yap::Shell::Parser::Nodes::RangeNode

Inherits:
Object
  • Object
show all
Includes:
Visitor
Defined in:
lib/yap/shell/parser/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visitor

#accept

Constructor Details

#initialize(head, tail = nil) ⇒ RangeNode

Returns a new instance of RangeNode.



315
316
317
318
# File 'lib/yap/shell/parser/nodes.rb', line 315

def initialize(head, tail=nil)
  @head = head
  @tail = tail
end

Instance Attribute Details

#headObject

Returns the value of attribute head.



313
314
315
# File 'lib/yap/shell/parser/nodes.rb', line 313

def head
  @head
end

#tailObject

Returns the value of attribute tail.



313
314
315
# File 'lib/yap/shell/parser/nodes.rb', line 313

def tail
  @tail
end

Instance Method Details

#inspectObject



324
325
326
# File 'lib/yap/shell/parser/nodes.rb', line 324

def inspect
  to_s
end

#to_s(indent: 0) ⇒ Object



320
321
322
# File 'lib/yap/shell/parser/nodes.rb', line 320

def to_s(indent:0)
  "(#{@head.inspect}, tail: #{tail.inspect})"
end