Class: Yap::Shell::Parser::Nodes::RedirectionNode

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(token) ⇒ RedirectionNode

Returns a new instance of RedirectionNode.



233
234
235
236
# File 'lib/yap/shell/parser/nodes.rb', line 233

def initialize(token)
  @kind = token.value
  @target = token.attrs[:target]
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



231
232
233
# File 'lib/yap/shell/parser/nodes.rb', line 231

def kind
  @kind
end

#targetObject (readonly)

Returns the value of attribute target.



231
232
233
# File 'lib/yap/shell/parser/nodes.rb', line 231

def target
  @target
end

Instance Method Details

#inspectObject



242
243
244
# File 'lib/yap/shell/parser/nodes.rb', line 242

def inspect
  to_s
end

#to_s(indent: 0) ⇒ Object



238
239
240
# File 'lib/yap/shell/parser/nodes.rb', line 238

def to_s(indent:0)
  "RedirectionNode(#{@kind.to_s}, #{@target.to_s})"
end