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.
-
#multi ⇒ Object
readonly
Returns the value of attribute multi.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #has_flag?(flag) ⇒ Boolean
-
#initialize(flags, parser = nil, multi = false) ⇒ Switch
constructor
A new instance of Switch.
Constructor Details
#initialize(flags, parser = nil, multi = false) ⇒ Switch
Returns a new instance of Switch.
31 32 33 34 35 |
# File 'lib/ejt_command_line.rb', line 31 def initialize(flags, parser = nil, multi = false) @flags = flags @parser = parser @multi = multi end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
29 30 31 |
# File 'lib/ejt_command_line.rb', line 29 def flags @flags end |
#multi ⇒ Object (readonly)
Returns the value of attribute multi.
29 30 31 |
# File 'lib/ejt_command_line.rb', line 29 def multi @multi end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
29 30 31 |
# File 'lib/ejt_command_line.rb', line 29 def parser @parser end |
Instance Method Details
#has_flag?(flag) ⇒ Boolean
37 38 39 |
# File 'lib/ejt_command_line.rb', line 37 def has_flag?(flag) @flags.member?(flag) end |