Class: FanartApi::Base

Inherits:
Object
  • Object
show all
Includes:
ServiceApi::BaseFaraday
Defined in:
lib/fanart_api/base.rb

Direct Known Subclasses

Movie, Music, Tv

Instance Method Summary collapse

Instance Method Details

#api_key_optionsObject



6
7
8
# File 'lib/fanart_api/base.rb', line 6

def api_key_options
  { api_key: @client.options[:api_key] }
end

#default_optionsObject



22
23
24
25
26
27
28
# File 'lib/fanart_api/base.rb', line 22

def default_options
  {
    type: 'all',
    sort: 1,
    limit: 2
  }
end

#find_pathObject



14
15
16
# File 'lib/fanart_api/base.rb', line 14

def find_path
  ':kind/:api_key/:id/json/:type/:sort/:limit'
end

#path_with_params(path, options) ⇒ Object



10
11
12
# File 'lib/fanart_api/base.rb', line 10

def path_with_params(path, options)
  path(path).params(api_key_options.merge(options))
end

#update_pathObject



18
19
20
# File 'lib/fanart_api/base.rb', line 18

def update_path
  ':kind/:api_key/:timestamp'
end