Class: HotelsPro::Api::ApiMethod

Inherits:
Object
  • Object
show all
Includes:
ApiParams, Virtus
Defined in:
lib/hotels_pro/api/api_method.rb

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Methods included from ApiParams

#api_param_name, #api_param_value, #to_api_params

Instance Method Details

#performObject



11
12
13
14
15
16
17
18
19
# File 'lib/hotels_pro/api/api_method.rb', line 11

def perform
  response = request.perform

  if response.error?
    raise response.error
  else
    "#{self.class.name}::Result".constantize.new(response.data)
  end
end