Class: Paypal::Base
- Inherits:
-
Object
- Object
- Paypal::Base
- Includes:
- AttrOptional, AttrRequired, Util
- Defined in:
- lib/paypal/base.rb
Direct Known Subclasses
NVP::Request, NVP::Response, Payment::Common::Amount, Payment::Recurring, Payment::Recurring::Activation, Payment::Recurring::Billing, Payment::Recurring::Summary, Payment::Request, Payment::Request::Item, Payment::Response, Payment::Response::Address, Payment::Response::Info, Payment::Response::Item, Payment::Response::Payer, Payment::Response::Reference, Payment::Response::Refund
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Util
#==, formatted_amount, #numeric_attribute?, to_numeric
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/paypal/base.rb', line 5 def initialize(attributes = {}) if attributes.is_a?(Hash) (required_attributes + optional_attributes).each do |key| value = if numeric_attribute?(key) Util.to_numeric(attributes[key]) else attributes[key] end self.send "#{key}=", value end end attr_missing! end |