Class: RubyPaypalNvp::Model::Item
- Inherits:
-
Object
- Object
- RubyPaypalNvp::Model::Item
- Defined in:
- lib/ruby_paypal_nvp/model/item.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#email ⇒ Object
Returns the value of attribute email.
-
#fee_amount ⇒ Object
Returns the value of attribute fee_amount.
-
#name ⇒ Object
Returns the value of attribute name.
-
#net_amount ⇒ Object
Returns the value of attribute net_amount.
-
#status ⇒ Object
Returns the value of attribute status.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.attributes ⇒ Object
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/CyclomaticComplexity rubocop:enable Metrics/PerceivedComplexity rubocop:enable Metrics/MethodLength.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Item
constructor
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/MethodLength.
- #to_csv ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Item
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/MethodLength
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 12 def initialize(hash = {}) @timestamp = hash['L_TIMESTAMP'] || nil @timezone = hash['L_TIMEZONE'] || nil @type = hash['L_TYPE'] || nil @email = hash['L_EMAIL'] || nil @name = hash['L_NAME'] || nil @transaction_id = hash['L_TRANSACTIONID'] || nil @status = hash['L_STATUS'] || nil @amount = (hash['L_AMT'] || nil).to_f @currency_code = hash['L_CURRENCYCODE'] || nil @fee_amount = (hash['L_FEEAMT'] || nil).to_f @net_amount = (hash['L_NETAMT'] || nil).to_f end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def amount @amount end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def currency_code @currency_code end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def email @email end |
#fee_amount ⇒ Object
Returns the value of attribute fee_amount.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def fee_amount @fee_amount end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def name @name end |
#net_amount ⇒ Object
Returns the value of attribute net_amount.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def net_amount @net_amount end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def status @status end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def @timestamp end |
#timezone ⇒ Object
Returns the value of attribute timezone.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def timezone @timezone end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def transaction_id @transaction_id end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 4 def type @type end |
Class Method Details
.attributes ⇒ Object
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/CyclomaticComplexity rubocop:enable Metrics/PerceivedComplexity rubocop:enable Metrics/MethodLength
30 31 32 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 30 def self.attributes new.instance_variable_names.map { |a| a.delete('@') } end |
Instance Method Details
#to_csv ⇒ Object
34 35 36 |
# File 'lib/ruby_paypal_nvp/model/item.rb', line 34 def to_csv instance_variables.map { |k| instance_variable_get(k) } end |