Class: CommandLine::Switch
- Inherits:
-
Object
- Object
- CommandLine::Switch
- Defined in:
- lib/ejt_command_line.rb
Overview
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #has_flag?(flag) ⇒ Boolean
-
#initialize(flags, parser = nil) ⇒ Switch
constructor
A new instance of Switch.
Constructor Details
#initialize(flags, parser = nil) ⇒ Switch
Returns a new instance of Switch.
44 45 46 47 |
# File 'lib/ejt_command_line.rb', line 44 def initialize(flags, parser = nil) @flags = flags @parser = parser end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
42 43 44 |
# File 'lib/ejt_command_line.rb', line 42 def flags @flags end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
42 43 44 |
# File 'lib/ejt_command_line.rb', line 42 def parser @parser end |
Instance Method Details
#has_flag?(flag) ⇒ Boolean
49 50 51 |
# File 'lib/ejt_command_line.rb', line 49 def has_flag?(flag) @flags.member?(flag) end |