Class: FreshTomatoes::Movie

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, url, tomatometer) ⇒ Movie

Returns a new instance of Movie.



6
7
8
9
10
11
# File 'lib/fresh_tomatoes/movie.rb', line 6

def initialize(title, url, tomatometer)
    @title = title
    @url = url
    @tomatometer = tomatometer
    @@all << self
end

Instance Attribute Details

#audience_scoreObject

Returns the value of attribute audience_score.



4
5
6
# File 'lib/fresh_tomatoes/movie.rb', line 4

def audience_score
  @audience_score
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/fresh_tomatoes/movie.rb', line 4

def description
  @description
end

#ratingObject

Returns the value of attribute rating.



4
5
6
# File 'lib/fresh_tomatoes/movie.rb', line 4

def rating
  @rating
end

#runtimeObject

Returns the value of attribute runtime.



4
5
6
# File 'lib/fresh_tomatoes/movie.rb', line 4

def runtime
  @runtime
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/fresh_tomatoes/movie.rb', line 3

def title
  @title
end

#tomatometerObject (readonly)

Returns the value of attribute tomatometer.



3
4
5
# File 'lib/fresh_tomatoes/movie.rb', line 3

def tomatometer
  @tomatometer
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/fresh_tomatoes/movie.rb', line 3

def url
  @url
end

Class Method Details

.allObject



13
14
15
# File 'lib/fresh_tomatoes/movie.rb', line 13

def self.all
    @@all
end