Class: OSDb::Movie

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#coverObject (readonly)

Returns the value of attribute cover.



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

def cover
  @cover
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#ratingObject (readonly)

Returns the value of attribute rating.



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

def rating
  @rating
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



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

def raw_data
  @raw_data
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#yearObject (readonly)

Returns the value of attribute year.



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

def year
  @year
end