Module: ComicVine::Api::ApiMethods

Included in:
ComicVine::Api
Defined in:
lib/comic_vine/api/api_methods.rb

Instance Method Summary collapse

Instance Method Details

#initial_define_api_methodsObject



12
13
14
15
16
17
# File 'lib/comic_vine/api/api_methods.rb', line 12

def initial_define_api_methods
  # types data from API has bug(s), in json file data are fixed
  path = File.join(File.dirname(__FILE__), '../../../config/types.json')
  stored_types = JSON.parse(File.read(path))
  define_api_methods(stored_types)
end

#redefine_api_methodsObject

Maybe in future ComicVine devs will fix bug in types, when it happened then you can still work with new endpoints, just run #redefine_api_methods method,



22
23
24
# File 'lib/comic_vine/api/api_methods.rb', line 22

def redefine_api_methods
  define_api_methods(types.results, true)
end

#search(args = {}) ⇒ Object



8
9
10
# File 'lib/comic_vine/api/api_methods.rb', line 8

def search(args = {})
  api_call('search', args)
end

#typesObject



4
5
6
# File 'lib/comic_vine/api/api_methods.rb', line 4

def types
  api_call('types', {})
end