Class: ROdds::Odd::Standardizer
- Inherits:
-
Object
- Object
- ROdds::Odd::Standardizer
- Defined in:
- lib/r_odds/standardizer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params) ⇒ Standardizer
constructor
A new instance of Standardizer.
Constructor Details
#initialize(params) ⇒ Standardizer
Returns a new instance of Standardizer.
9 10 11 12 |
# File 'lib/r_odds/standardizer.rb', line 9 def initialize(params) @raw_odd = params[:odd] @odd_format = params[:format] || ROdds::InferOddFormat.of(odd: raw_odd) end |
Class Method Details
.call(params) ⇒ Object
5 6 7 |
# File 'lib/r_odds/standardizer.rb', line 5 def self.call(params) new(params).call end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'lib/r_odds/standardizer.rb', line 14 def call standardizer_class = ROdds::OddStandardizer::ClassFactory.for(format: odd_format) standardizer_class.call(odd: raw_odd) end |