Class: YaKassa::V3::BaseRequest

Inherits:
Object
  • Object
show all
Extended by:
Concerns::Attributable
Includes:
Concerns::Validatable
Defined in:
lib/ya_kassa/v3/base_request.rb

Constant Summary

Constants included from Concerns::Validatable

Concerns::Validatable::VALIDATORS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Attributable

attributable

Methods included from Concerns::Validatable

#errors, included, #valid?

Constructor Details

#initialize(idempotence_key, params = {}) ⇒ BaseRequest

Returns a new instance of BaseRequest.



9
10
11
12
13
# File 'lib/ya_kassa/v3/base_request.rb', line 9

def initialize(idempotence_key, params = {})
  @params = params
  @idempotence_key = idempotence_key
  @response = nil
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/ya_kassa/v3/base_request.rb', line 7

def response
  @response
end

Instance Method Details

#bodyObject



20
21
22
# File 'lib/ya_kassa/v3/base_request.rb', line 20

def body
  { }
end

#createObject



15
16
17
18
# File 'lib/ya_kassa/v3/base_request.rb', line 15

def create
  return errors unless valid?
  send_request
end