Class: YTRating

Inherits:
Object
  • Object
show all
Defined in:
lib/yt_rating.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#averageObject

Returns the value of attribute average.



2
3
4
# File 'lib/yt_rating.rb', line 2

def average
  @average
end

#maxObject

Returns the value of attribute max.



2
3
4
# File 'lib/yt_rating.rb', line 2

def max
  @max
end

#minObject

Returns the value of attribute min.



2
3
4
# File 'lib/yt_rating.rb', line 2

def min
  @min
end

#num_ratersObject

Returns the value of attribute num_raters.



2
3
4
# File 'lib/yt_rating.rb', line 2

def num_raters
  @num_raters
end