Class: PayjpMock::Response::Resource::Base
- Includes:
- Util
- Defined in:
- lib/payjp_mock/response/resource/base.rb
Direct Known Subclasses
Account, Card, Charge, Customer, Event, Merchant, Plan, Subscription, Token, Transfer
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #canonicalize(key, value) ⇒ Object
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
- #set(attributes) ⇒ Object
- #status ⇒ Object
Methods included from Util
#generate_fingerprint, #generate_resource_id
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/payjp_mock/response/resource/base.rb', line 6 def initialize(attributes = {}) @attributes = default_attributes set(attributes.symbolize_keys) end |
Instance Method Details
#canonicalize(key, value) ⇒ Object
18 19 20 |
# File 'lib/payjp_mock/response/resource/base.rb', line 18 def canonicalize(key, value) { key => value } end |
#set(attributes) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/payjp_mock/response/resource/base.rb', line 11 def set(attributes) attributes.each do |k, v| @attributes.merge!(canonicalize(k, v)) end self end |
#status ⇒ Object
22 23 24 |
# File 'lib/payjp_mock/response/resource/base.rb', line 22 def status 200 end |