Class: TupaloApiClient
- Inherits:
-
Object
- Object
- TupaloApiClient
- Includes:
- APISmith::Client, TupaloApiErrors
- Defined in:
- lib/tupalo_api_client.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TupaloApiClient
constructor
A new instance of TupaloApiClient.
- #match(opts = {}) ⇒ Object
- #review_widget(opts = {}) ⇒ Object
- #spot_details(opts = {}) ⇒ Object
- #spots(opts = {}) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ TupaloApiClient
Returns a new instance of TupaloApiClient.
19 20 21 22 23 24 25 26 27 |
# File 'lib/tupalo_api_client.rb', line 19 def initialize(opts = {}) = { :lang => 'en', :token => '', :timeout => 15}.merge(opts) :token => [:token] unless [:token].empty? self.class.endpoint "#{[:lang]}/api/easy/v1" end |
Instance Method Details
#match(opts = {}) ⇒ Object
41 42 43 44 |
# File 'lib/tupalo_api_client.rb', line 41 def match(opts={}) transform = opts.has_key?(:spot_id) ? Match : Import get("match/#{parameterize(opts)}", :transform => transform) end |
#review_widget(opts = {}) ⇒ Object
37 38 39 |
# File 'lib/tupalo_api_client.rb', line 37 def (opts={}) get("review_widget/#{parameterize(opts)}", :transform => ReviewWidget) end |
#spot_details(opts = {}) ⇒ Object
33 34 35 |
# File 'lib/tupalo_api_client.rb', line 33 def spot_details(opts={}) get("spot/#{parameterize(opts)}", :transform => Spot) end |
#spots(opts = {}) ⇒ Object
29 30 31 |
# File 'lib/tupalo_api_client.rb', line 29 def spots(opts={}) get("spots/#{parameterize(opts)}", :transform => Spot) end |