Class: FilmOn::Genre
- Inherits:
-
Object
- Object
- FilmOn::Genre
- Defined in:
- lib/film_on/models/genre.rb
Overview
Genre is a group of movies bundled together such as “Sports” or “Horror” takes a raw hash and converts it into a nice ruby object
Defined Under Namespace
Classes: Image
Instance Attribute Summary collapse
-
#content_count ⇒ Object
readonly
Returns the value of attribute content_count.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#retina_image ⇒ Object
readonly
Returns the value of attribute retina_image.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#standard_image ⇒ Object
readonly
Returns the value of attribute standard_image.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#vendorka_id ⇒ Object
readonly
Returns the value of attribute vendorka_id.
Instance Method Summary collapse
- #get_images(imgs) ⇒ Object
-
#initialize(hash) ⇒ Genre
constructor
A new instance of Genre.
Constructor Details
#initialize(hash) ⇒ Genre
Returns a new instance of Genre.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/film_on/models/genre.rb', line 16 def initialize(hash) @id = hash["id"] @vendorka_id = hash["vendorka_id"] @name = hash["name"] @slug = hash["slug"] @position = hash["position"] @content_count = hash["content_count"] @updated_at = hash["updated_at"] @description = hash["description"] @images = get_images(hash["images"]) end |
Instance Attribute Details
#content_count ⇒ Object (readonly)
Returns the value of attribute content_count.
13 14 15 |
# File 'lib/film_on/models/genre.rb', line 13 def content_count @content_count end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
13 14 15 |
# File 'lib/film_on/models/genre.rb', line 13 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/film_on/models/genre.rb', line 12 def id @id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
13 14 15 |
# File 'lib/film_on/models/genre.rb', line 13 def images @images end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/film_on/models/genre.rb', line 12 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
12 13 14 |
# File 'lib/film_on/models/genre.rb', line 12 def position @position end |
#retina_image ⇒ Object (readonly)
Returns the value of attribute retina_image.
14 15 16 |
# File 'lib/film_on/models/genre.rb', line 14 def retina_image @retina_image end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
12 13 14 |
# File 'lib/film_on/models/genre.rb', line 12 def slug @slug end |
#standard_image ⇒ Object (readonly)
Returns the value of attribute standard_image.
14 15 16 |
# File 'lib/film_on/models/genre.rb', line 14 def standard_image @standard_image end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
13 14 15 |
# File 'lib/film_on/models/genre.rb', line 13 def updated_at @updated_at end |
#vendorka_id ⇒ Object (readonly)
Returns the value of attribute vendorka_id.
12 13 14 |
# File 'lib/film_on/models/genre.rb', line 12 def vendorka_id @vendorka_id end |