Class: Reading::Row::RatingAttribute
- Defined in:
- lib/reading/attribute/all_attributes.rb
Overview
The simpler attributes are collected below. The more complex attributes are separated into their own files.
Instance Method Summary collapse
Methods inherited from Attribute
Constructor Details
This class inherits a constructor from Reading::Row::Attribute
Instance Method Details
#parse ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/reading/attribute/all_attributes.rb', line 14 def parse return nil unless columns[:rating] = columns[:rating].strip return nil if .empty? Integer(, exception: false) || Float(, exception: false) || (raise InvalidRatingError, "Invalid rating") end |