Class: ArrowPayments::Entity
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- ArrowPayments::Entity
- Includes:
- Hashie::Extensions::Coercion
- Defined in:
- lib/arrow_payments/entity.rb
Direct Known Subclasses
Address, Customer, LineItem, PaymentMethod, RecurringBilling, Transaction
Class Attribute Summary collapse
-
.properties_map ⇒ Object
readonly
Returns the value of attribute properties_map.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.properties_map ⇒ Object (readonly)
Returns the value of attribute properties_map.
8 9 10 |
# File 'lib/arrow_payments/entity.rb', line 8 def properties_map @properties_map end |
Class Method Details
.property(property_name, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/arrow_payments/entity.rb', line 24 def self.property(property_name, = {}) super(property_name, ) if [:from] @properties_map ||= {} @properties_map[property_name.to_sym] = [:from].to_s end end |
Instance Method Details
#to_source_hash(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/arrow_payments/entity.rb', line 13 def to_source_hash(={}) hash = {} self.class.properties_map.each_pair do |k, v| val = send(k) hash[v] = val unless val.nil? end hash end |