class Clio::Usage::Signature
Command Signature¶ ↑
Used by the Usage::Parser as the end result of parsing a Usage::Command.
Attributes
arguments[R]
command[R]
options[R]
signature[R]
Public Class Methods
new(c, a, o)
click to toggle source
# File lib/clio/usage/signature.rb, line 11 def initialize(c, a, o) @signature = [c, a, o] @command = c @arguments = a @options = o end
Public Instance Methods
inspect()
click to toggle source
# File lib/clio/usage/signature.rb, line 29 def inspect; "#<#{self.class}:" + @signature.inspect + ">"; end
method_missing(s, *a)
click to toggle source
# File lib/clio/usage/signature.rb, line 32 def method_missing(s, *a) s = s.to_s case s #when /[=]$/ # n = s.chomp('=') # usage.option(n).type(*a) # #parser.parse # res = parser.options[n.to_sym] #when /[!]$/ # n = s.chomp('!') # res = parser.parse when /[?]$/ options[s.chomp('?').to_sym] else options[s.to_sym] end end
parameters()
click to toggle source
# File lib/clio/usage/signature.rb, line 25 def parameters @arguments + [@options] end
to_a()
click to toggle source
# File lib/clio/usage/signature.rb, line 23 def to_a; @signature; end