Class: OSDb::Movie
- Inherits:
-
Object
- Object
- OSDb::Movie
- Defined in:
- lib/osdb/movie.rb
Instance Attribute Summary collapse
-
#cover ⇒ Object
readonly
Returns the value of attribute cover.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(data) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(data) ⇒ Movie
Returns a new instance of Movie.
6 7 8 9 10 11 12 13 |
# File 'lib/osdb/movie.rb', line 6 def initialize(data) @id = data['id'] @title = data['title'] @year = data['year'] && data['year'].to_i @cover = data['cover'] @rating = data['rating'] && data['rating'].to_f @raw_data = data end |
Instance Attribute Details
#cover ⇒ Object (readonly)
Returns the value of attribute cover.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def cover @cover end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def id @id end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def @rating end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def raw_data @raw_data end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def title @title end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
4 5 6 |
# File 'lib/osdb/movie.rb', line 4 def year @year end |