Class: MSpecOption
- Defined in:
- lib/extensions/mspec/mspec/utils/options.rb
Instance Attribute Summary collapse
-
#arg ⇒ Object
readonly
Returns the value of attribute arg.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#long ⇒ Object
readonly
Returns the value of attribute long.
-
#short ⇒ Object
readonly
Returns the value of attribute short.
Instance Method Summary collapse
- #arg? ⇒ Boolean
-
#initialize(short, long, arg, description, block) ⇒ MSpecOption
constructor
A new instance of MSpecOption.
- #match?(opt) ⇒ Boolean
Constructor Details
#initialize(short, long, arg, description, block) ⇒ MSpecOption
Returns a new instance of MSpecOption.
8 9 10 11 12 13 14 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 8 def initialize(short, long, arg, description, block) @short = short @long = long @arg = arg @description = description @block = block end |
Instance Attribute Details
#arg ⇒ Object (readonly)
Returns the value of attribute arg.
6 7 8 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 def arg @arg end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 def block @block end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 def description @description end |
#long ⇒ Object (readonly)
Returns the value of attribute long.
6 7 8 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 def long @long end |
#short ⇒ Object (readonly)
Returns the value of attribute short.
6 7 8 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 def short @short end |
Instance Method Details
#arg? ⇒ Boolean
16 17 18 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 16 def arg? @arg != nil end |
#match?(opt) ⇒ Boolean
20 21 22 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 20 def match?(opt) opt == @short or opt == @long end |