Class: Belafonte::Argument
- Inherits:
-
Object
- Object
- Belafonte::Argument
- Defined in:
- lib/belafonte/argument.rb,
lib/belafonte/argument/argv_processor.rb,
lib/belafonte/argument/occurrence_normalizer.rb,
lib/belafonte/argument/argv_processor/processor.rb,
lib/belafonte/argument/argv_processor/unlimited.rb,
lib/belafonte/argument/occurrence_normalizer/single.rb,
lib/belafonte/argument/occurrence_normalizer/unlimited.rb,
lib/belafonte/argument/occurrence_normalizer/normalizer.rb
Overview
Represents a command line argument
Defined Under Namespace
Modules: ARGVProcessor, OccurrenceNormalizer
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#times ⇒ Object
readonly
Returns the value of attribute times.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Argument
constructor
A new instance of Argument.
- #process(argv) ⇒ Object
- #unlimited? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Argument
Returns a new instance of Argument.
10 11 12 13 14 |
# File 'lib/belafonte/argument.rb', line 10 def initialize( = {}) @name = [:name] @times = [:times] normalize end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/belafonte/argument.rb', line 8 def name @name end |
#times ⇒ Object (readonly)
Returns the value of attribute times.
8 9 10 |
# File 'lib/belafonte/argument.rb', line 8 def times @times end |
Instance Method Details
#process(argv) ⇒ Object
16 17 18 |
# File 'lib/belafonte/argument.rb', line 16 def process(argv) ARGVProcessor.process(times, argv).clone end |
#unlimited? ⇒ Boolean
20 21 22 |
# File 'lib/belafonte/argument.rb', line 20 def unlimited? @unlimited ||= false end |