Class: Reading::Parsing::Attributes::Rating
- Defined in:
- lib/reading/parsing/attributes/rating.rb
Overview
Transformer for the :rating item attribute.
Instance Method Summary collapse
Instance Method Details
#transform_from_parsed(parsed_row, _head_index) ⇒ Integer, Float
9 10 11 12 13 |
# File 'lib/reading/parsing/attributes/rating.rb', line 9 def transform_from_parsed(parsed_row, _head_index) = parsed_row[:rating]&.dig(:number) Integer(, exception: false) || Float(, exception: false) end |