class Clio::Usage::Argument
Usage Argument¶ ↑
TODO: Should argument have name in addition to type?
Attributes
help[R]
splat[R]
type[R]
attr :parent attr :name
Public Class Methods
new(type, &block)
click to toggle source
New Argument.
# File lib/clio/usage/argument.rb, line 16 def initialize(type, &block) @type = type #@name = type.downcase if type.upcase != type @splat = false @help = '' instance_eval(&block) if block end
Public Instance Methods
initialize_copy(o)
click to toggle source
# File lib/clio/usage/argument.rb, line 25 def initialize_copy(o) #@name = o.name.dup @type = o.type.dup @help = o.help.dup end
inspect()
click to toggle source
# File lib/clio/usage/argument.rb, line 73 def inspect to_s #s = "<#{name}" #s << ":#{type.inspect}" if type #s << ">" #s end
to_s()
click to toggle source
# File lib/clio/usage/argument.rb, line 67 def to_s s = "<#{type}" s << (splat ? "...>" : ">") s end