Class: JustWatch::Provider

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

Constant Summary collapse

PROVIDER_PATH =
'/providers/all/locale'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#clear_nameObject

Returns the value of attribute clear_name

Returns:

  • (Object)

    the current value of clear_name



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

def clear_name
  @clear_name
end

#icon_urlObject

Returns the value of attribute icon_url

Returns:

  • (Object)

    the current value of icon_url



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

def icon_url
  @icon_url
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



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

def id
  @id
end

#monetization_typesObject

Returns the value of attribute monetization_types

Returns:

  • (Object)

    the current value of monetization_types



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

def monetization_types
  @monetization_types
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/provider.rb', line 4

def short_name
  @short_name
end

#slugObject

Returns the value of attribute slug

Returns:

  • (Object)

    the current value of slug



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

def slug
  @slug
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/provider.rb', line 4

def technical_name
  @technical_name
end

Class Method Details

.list(locale: Api.locale) ⇒ Object



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

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

  providers.map do |provider|
    new(provider.slice(*members))
  end
end