Class: Magick::FeatureVariant
- Inherits:
-
Object
- Object
- Magick::FeatureVariant
- Defined in:
- lib/magick/feature_variant.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(name, value, weight: 0) ⇒ FeatureVariant
constructor
A new instance of FeatureVariant.
- #to_h ⇒ Object
Constructor Details
#initialize(name, value, weight: 0) ⇒ FeatureVariant
Returns a new instance of FeatureVariant.
7 8 9 10 11 |
# File 'lib/magick/feature_variant.rb', line 7 def initialize(name, value, weight: 0) @name = name.to_s @value = value @weight = weight.to_f end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/magick/feature_variant.rb', line 5 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/magick/feature_variant.rb', line 5 def value @value end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
5 6 7 |
# File 'lib/magick/feature_variant.rb', line 5 def weight @weight end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/magick/feature_variant.rb', line 13 def to_h { name: name, value: value, weight: weight } end |