Class: Okmain::Config
- Inherits:
-
Object
- Object
- Okmain::Config
- Defined in:
- lib/okmain/config.rb
Instance Attribute Summary collapse
-
#chroma_weight ⇒ Object
readonly
Returns the value of attribute chroma_weight.
-
#mask_weighted_counts_weight ⇒ Object
readonly
Returns the value of attribute mask_weighted_counts_weight.
Instance Method Summary collapse
-
#initialize(chroma_weight: 0.7, mask_weighted_counts_weight: 0.3) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(chroma_weight: 0.7, mask_weighted_counts_weight: 0.3) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 |
# File 'lib/okmain/config.rb', line 7 def initialize(chroma_weight: 0.7, mask_weighted_counts_weight: 0.3) raise ArgumentError, "chroma_weight must be between 0 and 1" unless (0.0..1.0).cover?(chroma_weight) raise ArgumentError, "mask_weighted_counts_weight must be between 0 and 1" unless (0.0..1.0).cover?(mask_weighted_counts_weight) @chroma_weight = chroma_weight.to_f @mask_weighted_counts_weight = mask_weighted_counts_weight.to_f end |
Instance Attribute Details
#chroma_weight ⇒ Object (readonly)
Returns the value of attribute chroma_weight.
5 6 7 |
# File 'lib/okmain/config.rb', line 5 def chroma_weight @chroma_weight end |
#mask_weighted_counts_weight ⇒ Object (readonly)
Returns the value of attribute mask_weighted_counts_weight.
5 6 7 |
# File 'lib/okmain/config.rb', line 5 def mask_weighted_counts_weight @mask_weighted_counts_weight end |