Class: AlphaCard::Resource
- Inherits:
-
Object
- Object
- AlphaCard::Resource
- Includes:
- Attribute
- Defined in:
- lib/alpha_card/resource.rb
Overview
Alpha Card resource base class.
Direct Known Subclasses
Constant Summary collapse
- ORIGIN_TRANSACTION_VARIABLES =
Original AlphaCard transaction variables names
{}.freeze
Instance Method Summary collapse
-
#attributes_for_request(attrs = filled_attributes) ⇒ Object
Returns only filled attributes with the original Alpha Card Services transaction variables names.
Methods included from Attribute
Instance Method Details
#attributes_for_request(attrs = filled_attributes) ⇒ Object
Returns only filled attributes with the original Alpha Card Services transaction variables names.
26 27 28 29 30 31 32 |
# File 'lib/alpha_card/resource.rb', line 26 def attributes_for_request(attrs = filled_attributes) return attrs if self.class::ORIGIN_TRANSACTION_VARIABLES.empty? attrs.each_with_object({}) do |(attr, value), request_attrs| request_attrs[self.class::ORIGIN_TRANSACTION_VARIABLES.fetch(attr, attr)] = value end end |