class Drudge::Param
Represents a command parameter
Constants
- TYPES
Attributes
name[R]
the argument’s name
optional[R]
optional?[R]
splatt[R]
splatt?[R]
type[R]
the argument’s type
Public Class Methods
new(name, type, optional: false, splatt: false)
click to toggle source
# File lib/drudge/command.rb, line 77 def initialize(name, type, optional: false, splatt: false) @name = name.to_sym @type = type.to_sym @optional = !! optional @splatt = !! splatt end
Public Instance Methods
argument_parser()
click to toggle source
returns a parser that is able to parse arguments fitting this parameter
# File lib/drudge/command.rb, line 86 def argument_parser arg(name, value(/.+/)) end