Class: YTRating
- Inherits:
-
Object
- Object
- YTRating
- Defined in:
- lib/yt_rating.rb
Instance Attribute Summary collapse
-
#average ⇒ Object
Returns the value of attribute average.
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
-
#num_raters ⇒ Object
Returns the value of attribute num_raters.
Instance Method Summary collapse
-
#initialize(data) ⇒ YTRating
constructor
A new instance of YTRating.
Constructor Details
#initialize(data) ⇒ YTRating
Returns a new instance of YTRating.
4 5 6 7 8 9 |
# File 'lib/yt_rating.rb', line 4 def initialize(data) @num_raters = data[:num_raters].to_i @min = data[:min].to_i @max = data[:max].to_i @average = data[:average].to_f end |
Instance Attribute Details
#average ⇒ Object
Returns the value of attribute average.
2 3 4 |
# File 'lib/yt_rating.rb', line 2 def average @average end |
#max ⇒ Object
Returns the value of attribute max.
2 3 4 |
# File 'lib/yt_rating.rb', line 2 def max @max end |
#min ⇒ Object
Returns the value of attribute min.
2 3 4 |
# File 'lib/yt_rating.rb', line 2 def min @min end |
#num_raters ⇒ Object
Returns the value of attribute num_raters.
2 3 4 |
# File 'lib/yt_rating.rb', line 2 def num_raters @num_raters end |