Class: Visupedia::Api::Visu
- Inherits:
-
Object
- Object
- Visupedia::Api::Visu
- Defined in:
- lib/visupedia/api/visu.rb
Overview
Returns an MyVisu api instance
key - The api key provided by Visupedia
Instance Method Summary collapse
-
#get(id, lang, version, options = {}) ⇒ Object
Returns all information about the wanted Visu.
-
#initialize(key, client) ⇒ Visu
constructor
A new instance of Visu.
Constructor Details
#initialize(key, client) ⇒ Visu
Returns a new instance of Visu.
10 11 12 13 |
# File 'lib/visupedia/api/visu.rb', line 10 def initialize(key, client) @key = key @client = client end |
Instance Method Details
#get(id, lang, version, options = {}) ⇒ Object
Returns all information about the wanted Visu
‘/api?key=:key&id=:id&lang=:lang&version=:version’ GET
id - The unique ID of the Visu lang - The language code wanted for the Visu version - Use a specific version of our API
22 23 24 25 26 27 28 29 |
# File 'lib/visupedia/api/visu.rb', line 22 def get(id, lang, version, = {}) body = .fetch(:query, {}) body[:id] = id body[:lang] = lang body[:version] = version @client.get("/api?key=#{@key}&id=#{id}&lang=#{lang}&version=#{version}", body, ) end |