class RakutenApi::Base::Client
Public Class Methods
new(application_id = nil, affiliate_id = nil) { |params| ... }
click to toggle source
# File lib/rakuten_api/base/client.rb, line 5 def initialize(application_id = nil, affiliate_id = nil) init_params(application_id, affiliate_id) yield @params if block_given? end
Public Instance Methods
add_param(name, value)
click to toggle source
# File lib/rakuten_api/base/client.rb, line 30 def add_param(name, value) @params[name] = value end
connection()
click to toggle source
# File lib/rakuten_api/base/client.rb, line 22 def connection @connection ||= new_connection end
get()
click to toggle source
# File lib/rakuten_api/base/client.rb, line 14 def get raise "not implement" end
init_params(application_id, affiliate_id)
click to toggle source
# File lib/rakuten_api/base/client.rb, line 10 def init_params(application_id, affiliate_id) raise "not implement" end
new_connection()
click to toggle source
# File lib/rakuten_api/base/client.rb, line 34 def new_connection ::Faraday.new(url: ::RakutenApi::APPLICATION_END_POINT) do |faraday| faraday.request :url_encoded faraday.adapter Faraday.default_adapter end end
params()
click to toggle source
# File lib/rakuten_api/base/client.rb, line 26 def params @params.to_hash end
request()
click to toggle source
# File lib/rakuten_api/base/client.rb, line 18 def request raise "not implement" end