Class: OptionDefinition
- Inherits:
-
Object
- Object
- OptionDefinition
- Defined in:
- lib/image_optim/option_definition.rb
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.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, default, type, description, &proc) ⇒ OptionDefinition
constructor
A new instance of OptionDefinition.
Constructor Details
#initialize(name, default, type, description, &proc) ⇒ OptionDefinition
Returns a new instance of OptionDefinition.
5 6 7 8 9 10 11 12 13 |
# File 'lib/image_optim/option_definition.rb', line 5 def initialize(name, default, type, description, &proc) if type.is_a?(String) type, description = default.class, type end @name = name.to_sym @description = description.to_s @default, @type, @proc = default, type, proc end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
3 4 5 |
# File 'lib/image_optim/option_definition.rb', line 3 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/image_optim/option_definition.rb', line 3 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/image_optim/option_definition.rb', line 3 def name @name end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
3 4 5 |
# File 'lib/image_optim/option_definition.rb', line 3 def proc @proc end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/image_optim/option_definition.rb', line 3 def type @type end |