Module: PartnerApi::Endpoints::Initializer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(klass) ⇒ Object



129
130
131
132
133
134
135
# File 'lib/partner_api/endpoints/base.rb', line 129

def self.prepended(klass)
  klass.class_eval do
    def self.call(config, **params)
      new(config, **params).call
    end
  end
end

Instance Method Details

#initialize(config, **params) ⇒ Object



137
138
139
140
141
142
143
144
145
# File 'lib/partner_api/endpoints/base.rb', line 137

def initialize(config, **params)
  @config = config

  if params.empty?
    super()
  else
    super(**params)
  end
end