Class: Clip::Flag
- Inherits:
-
Object
- Object
- Clip::Flag
- Defined in:
- lib/clip.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#long ⇒ Object
Returns the value of attribute long.
-
#short ⇒ Object
Returns the value of attribute short.
Instance Method Summary collapse
- #has_default? ⇒ Boolean
-
#initialize(short, long, options) ⇒ Flag
constructor
nodoc.
- #process(parser, value) ⇒ Object
- #required? ⇒ Boolean
- #usage ⇒ Object
Constructor Details
#initialize(short, long, options) ⇒ Flag
nodoc
314 315 316 317 318 |
# File 'lib/clip.rb', line 314 def initialize(short, long, ) @short = short @long = long @description = [:desc] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
310 311 312 |
# File 'lib/clip.rb', line 310 def description @description end |
#long ⇒ Object
Returns the value of attribute long.
310 311 312 |
# File 'lib/clip.rb', line 310 def long @long end |
#short ⇒ Object
Returns the value of attribute short.
310 311 312 |
# File 'lib/clip.rb', line 310 def short @short end |
Instance Method Details
#has_default? ⇒ Boolean
328 329 330 |
# File 'lib/clip.rb', line 328 def has_default? false end |
#process(parser, value) ⇒ Object
320 321 322 |
# File 'lib/clip.rb', line 320 def process(parser, value) parser.send("flag_#{@long}".to_sym) end |
#required? ⇒ Boolean
324 325 326 |
# File 'lib/clip.rb', line 324 def required? false end |
#usage ⇒ Object
332 333 334 |
# File 'lib/clip.rb', line 332 def usage sprintf('-%-2s --%-10s %s', @short, @long, @description) end |