Class: ShellOpts::Ast::Option

Inherits:
Node
  • Object
show all
Defined in:
lib/shellopts/ast/option.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#grammar, #name

Instance Method Summary collapse

Methods inherited from Node

#key, #to_tuple

Constructor Details

#initialize(grammar, name, value) ⇒ Option

Returns a new instance of Option.



7
8
9
10
# File 'lib/shellopts/ast/option.rb', line 7

def initialize(grammar, name, value)
  super(grammar, name)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Optional value. Can be a String, Integer, or Float



5
6
7
# File 'lib/shellopts/ast/option.rb', line 5

def value
  @value
end

Instance Method Details

#dumpObject

:nocov:



15
16
17
# File 'lib/shellopts/ast/option.rb', line 15

def dump
  super { puts "values: #{values.inspect}" }
end

#valuesObject



12
# File 'lib/shellopts/ast/option.rb', line 12

def values() value end