class BtcPay::Client::Service
Attributes
base_path[R]
client[R]
logger[R]
Public Class Methods
new(client:)
click to toggle source
# File lib/btcpay/client/service.rb, line 6 def initialize(client:) @base_path = set_base_path @client = client @logger = @client.logger end
Protected Instance Methods
path(*args)
click to toggle source
# File lib/btcpay/client/service.rb, line 14 def path(*args) request_path = args.prepend(base_path.presence).compact.join('/') request_path[0].eql?('/') ? request_path : '/' + request_path end
set_base_path()
click to toggle source
# File lib/btcpay/client/service.rb, line 24 def set_base_path raise NotImplementedError.new end
store_path(store_id, *args)
click to toggle source
# File lib/btcpay/client/service.rb, line 19 def store_path(store_id, *args) base_path.gsub!(':store_id', store_id) path(*args) end