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.
6 7 8 9 10 11 12 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6 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.
4 5 6 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 4 def arg @arg end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 4 def block @block end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 4 def description @description end |
#long ⇒ Object (readonly)
Returns the value of attribute long.
4 5 6 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 4 def long @long end |
#short ⇒ Object (readonly)
Returns the value of attribute short.
4 5 6 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 4 def short @short end |
Instance Method Details
#arg? ⇒ Boolean
14 15 16 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 14 def arg? @arg != nil end |
#match?(opt) ⇒ Boolean
18 19 20 |
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 18 def match?(opt) opt == @short or opt == @long end |