Class: JustWatch::Genre

Inherits:
Struct
  • Object
show all
Defined in:
lib/just_watch/genre.rb

Constant Summary collapse

GENRE_PATH =
'/genres/all/locale'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



4
5
6
# File 'lib/just_watch/genre.rb', line 4

def id
  @id
end

#short_nameObject

Returns the value of attribute short_name

Returns:

  • (Object)

    the current value of short_name



4
5
6
# File 'lib/just_watch/genre.rb', line 4

def short_name
  @short_name
end

#technical_nameObject

Returns the value of attribute technical_name

Returns:

  • (Object)

    the current value of technical_name



4
5
6
# File 'lib/just_watch/genre.rb', line 4

def technical_name
  @technical_name
end

#translationObject

Returns the value of attribute translation

Returns:

  • (Object)

    the current value of translation



4
5
6
# File 'lib/just_watch/genre.rb', line 4

def translation
  @translation
end

Class Method Details

.list(locale: Api.locale) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/just_watch/genre.rb', line 8

def list(locale: Api.locale)
  genres = Api.request([GENRE_PATH, locale].join('/'))

  genres.map do |genre|
    new(genre.slice(*members))
  end
end