Class: Docopt::Argument
- Inherits:
-
ChildPattern
- Object
- Pattern
- ChildPattern
- Docopt::Argument
- Defined in:
- lib/docopt.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from ChildPattern
Attributes inherited from Pattern
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ChildPattern
#flat, #initialize, #inspect, #match
Methods inherited from Pattern
#==, #dump, #either, #fix, #fix_identities, #fix_repeating_arguments, #to_str
Constructor Details
This class inherits a constructor from Docopt::ChildPattern
Class Method Details
.parse(class_, source) ⇒ Object
209 210 211 212 213 |
# File 'lib/docopt.rb', line 209 def self.parse(class_, source) name = /(<\S*?>)/.match(source)[0] value = /\[default: (.*)\]/i.match(source) class_.new(name, (value ? value[0] : nil)) end |