Class: Uncov::Configuration::Option
- Inherits:
-
Object
- Object
- Uncov::Configuration::Option
- Defined in:
- lib/uncov/configuration/option.rb
Overview
configuration option
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#value ⇒ Object
Returns the value of attribute value.
-
#value_parse ⇒ Object
readonly
Returns the value of attribute value_parse.
Instance Method Summary collapse
-
#initialize(name, description, options, default, allowed_values, value_parse) ⇒ Option
constructor
A new instance of Option.
- #on_parser(parser) ⇒ Object
Constructor Details
#initialize(name, description, options, default, allowed_values, value_parse) ⇒ Option
Returns a new instance of Option.
7 8 9 10 11 12 13 14 15 |
# File 'lib/uncov/configuration/option.rb', line 7 def initialize(name, description, , default, allowed_values, value_parse) @name = name @description = description = Array() @default = default.freeze @value = default @allowed_values = allowed_values @value_parse = value_parse end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def value @value end |
#value_parse ⇒ Object (readonly)
Returns the value of attribute value_parse.
5 6 7 |
# File 'lib/uncov/configuration/option.rb', line 5 def value_parse @value_parse end |
Instance Method Details
#on_parser(parser) ⇒ Object
27 |
# File 'lib/uncov/configuration/option.rb', line 27 def on_parser(parser) = parser.on(*, ) { |value| self.value = value_parse.call(value) } |