Class: Setsuzoku::Service::WebService::ApiStrategy

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Includes:
ApiStrategy
Defined in:
lib/setsuzoku/service/web_service/api_strategy.rb

Defined Under Namespace

Modules: InterfaceMethods

Instance Attribute Summary

Attributes included from ApiStrategy

#current_action, #service

Instance Method Summary collapse

Methods included from ApiStrategy

#call_external_api, #final, #initialize

Instance Method Details

#parse_response(response:, **options) ⇒ Object



76
77
78
79
80
81
82
83
84
85
# File 'lib/setsuzoku/service/web_service/api_strategy.rb', line 76

def parse_response(response:, **options)
  case options[:response_type]
  when :json
    JSON.parse(response.body).deep_symbolize_keys
  when :xml
    convert_xml_to_hash(response.body)
  else
    JSON.parse(response.body).deep_symbolize_keys
  end
end

#perform_external_call(request:, action_details:, **options) ⇒ Object



66
# File 'lib/setsuzoku/service/web_service/api_strategy.rb', line 66

def perform_external_call(request:, action_details:, **options); end