Method: V::Arguments::Slot#initialize
- Defined in:
- lib/v/arguments.rb
#initialize(argument, defaults, options) ⇒ Slot
Returns a new instance of Slot.
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/v/arguments.rb', line 70 def initialize(argument, defaults, ) @to_s, @to_sym = "#{ argument }".gsub('_', '-'), argument @captures = [argument] = @standalone, @defaults = defaults.empty?, defaults.map { |d| d.to_s } @fstring = if [:rude] then '%s' elsif [:alias] and @standalone then '-$op' elsif [:alias] and not @standalone then '-$op %s' elsif not [:alias] and @standalone then '--$op' else '--$op=%s' end end |