Class: PaymentRecipes::PayPal::REST::Payer
- Inherits:
-
Object
- Object
- PaymentRecipes::PayPal::REST::Payer
- Includes:
- Utils::Converters
- Defined in:
- lib/payment_recipes/paypal/rest/payer.rb
Instance Attribute Summary collapse
-
#funding_instruments ⇒ Object
readonly
Returns the value of attribute funding_instruments.
-
#payment_method ⇒ Object
readonly
Returns the value of attribute payment_method.
-
#raw_payer ⇒ Object
readonly
Returns the value of attribute raw_payer.
Instance Method Summary collapse
- #funding_instrument ⇒ Object
-
#initialize(paypal_payer) ⇒ Payer
constructor
A new instance of Payer.
- #inspect ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
Methods included from Utils::Converters
#convert_to_money, #convert_to_string, #convert_to_symbol, #convert_to_time
Constructor Details
#initialize(paypal_payer) ⇒ Payer
Returns a new instance of Payer.
11 12 13 14 15 16 17 18 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 11 def initialize(paypal_payer) unless paypal_payer.is_a?(::PayPal::SDK::REST::DataTypes::Payer) raise Exception, "#{ self.class.name } must be initialized with a PayPal Payer" end @payment_method = convert_to_symbol(paypal_payer.payment_method) @raw_payer = paypal_payer end |
Instance Attribute Details
#funding_instruments ⇒ Object (readonly)
Returns the value of attribute funding_instruments.
6 7 8 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 6 def funding_instruments @funding_instruments end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
5 6 7 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 5 def payment_method @payment_method end |
#raw_payer ⇒ Object (readonly)
Returns the value of attribute raw_payer.
7 8 9 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 7 def raw_payer @raw_payer end |
Instance Method Details
#funding_instrument ⇒ Object
20 21 22 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 20 def funding_instrument @funding_instruments.first end |
#inspect ⇒ Object
24 25 26 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 24 def inspect to_str end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 28 def to_s to_str end |
#to_str ⇒ Object
32 33 34 |
# File 'lib/payment_recipes/paypal/rest/payer.rb', line 32 def to_str "<#{ self.class.name } payment_method=#{ @payment_method }>" end |