Class: CLI::Values

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/cli.rb

Instance Method Summary collapse

Instance Method Details

#append(argument, value) ⇒ Object



100
101
102
103
104
# File 'lib/cli.rb', line 100

def append(argument, value)
	v = (get(argument) or [])
	v << value
	send((argument.name.to_s + '=').to_sym, v) 
end

#get(argument) ⇒ Object



110
111
112
# File 'lib/cli.rb', line 110

def get(argument)
	send(argument.name.to_s)
end

#set(argument) ⇒ Object



106
107
108
# File 'lib/cli.rb', line 106

def set(argument)
	value(argument, true)
end

#value(argument, value) ⇒ Object



96
97
98
# File 'lib/cli.rb', line 96

def value(argument, value)
	send((argument.name.to_s + '=').to_sym, value) 
end