Class: ChartMogul::Import::Invoice::LineItem
- Inherits:
-
Object
- Object
- ChartMogul::Import::Invoice::LineItem
- Defined in:
- lib/chart_mogul/import/invoice.rb
Instance Attribute Summary collapse
-
#amount_in_cents ⇒ Object
readonly
Returns the value of attribute amount_in_cents.
-
#discount_amount_in_cents ⇒ Object
readonly
Returns the value of attribute discount_amount_in_cents.
-
#discount_code ⇒ Object
readonly
Returns the value of attribute discount_code.
-
#external_id ⇒ Object
readonly
Returns the value of attribute external_id.
-
#plan_uuid ⇒ Object
readonly
Returns the value of attribute plan_uuid.
-
#prorated ⇒ Object
readonly
Returns the value of attribute prorated.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#service_period_end ⇒ Object
readonly
Returns the value of attribute service_period_end.
-
#service_period_start ⇒ Object
readonly
Returns the value of attribute service_period_start.
-
#subscription_uuid ⇒ Object
readonly
Returns the value of attribute subscription_uuid.
-
#tax_amount_in_cents ⇒ Object
readonly
Returns the value of attribute tax_amount_in_cents.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(args) ⇒ LineItem
constructor
A new instance of LineItem.
Constructor Details
#initialize(args) ⇒ LineItem
Returns a new instance of LineItem.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/chart_mogul/import/invoice.rb', line 28 def initialize(args) %i{uuid external_id type subscription_uuid plan_uuid prorated amount_in_cents quantity discount_code discount_amount_in_cents tax_amount_in_cents} .each do |key| instance_variable_set("@#{key}", args[key]) end %i{service_period_start service_period_end} .each do |key| instance_variable_set("@#{key}", Time.parse(args[key])) if args[key] end end |
Instance Attribute Details
#amount_in_cents ⇒ Object (readonly)
Returns the value of attribute amount_in_cents.
22 23 24 |
# File 'lib/chart_mogul/import/invoice.rb', line 22 def amount_in_cents @amount_in_cents end |
#discount_amount_in_cents ⇒ Object (readonly)
Returns the value of attribute discount_amount_in_cents.
25 26 27 |
# File 'lib/chart_mogul/import/invoice.rb', line 25 def discount_amount_in_cents @discount_amount_in_cents end |
#discount_code ⇒ Object (readonly)
Returns the value of attribute discount_code.
24 25 26 |
# File 'lib/chart_mogul/import/invoice.rb', line 24 def discount_code @discount_code end |
#external_id ⇒ Object (readonly)
Returns the value of attribute external_id.
15 16 17 |
# File 'lib/chart_mogul/import/invoice.rb', line 15 def external_id @external_id end |
#plan_uuid ⇒ Object (readonly)
Returns the value of attribute plan_uuid.
18 19 20 |
# File 'lib/chart_mogul/import/invoice.rb', line 18 def plan_uuid @plan_uuid end |
#prorated ⇒ Object (readonly)
Returns the value of attribute prorated.
19 20 21 |
# File 'lib/chart_mogul/import/invoice.rb', line 19 def prorated @prorated end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
23 24 25 |
# File 'lib/chart_mogul/import/invoice.rb', line 23 def quantity @quantity end |
#service_period_end ⇒ Object (readonly)
Returns the value of attribute service_period_end.
21 22 23 |
# File 'lib/chart_mogul/import/invoice.rb', line 21 def service_period_end @service_period_end end |
#service_period_start ⇒ Object (readonly)
Returns the value of attribute service_period_start.
20 21 22 |
# File 'lib/chart_mogul/import/invoice.rb', line 20 def service_period_start @service_period_start end |
#subscription_uuid ⇒ Object (readonly)
Returns the value of attribute subscription_uuid.
17 18 19 |
# File 'lib/chart_mogul/import/invoice.rb', line 17 def subscription_uuid @subscription_uuid end |
#tax_amount_in_cents ⇒ Object (readonly)
Returns the value of attribute tax_amount_in_cents.
26 27 28 |
# File 'lib/chart_mogul/import/invoice.rb', line 26 def tax_amount_in_cents @tax_amount_in_cents end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/chart_mogul/import/invoice.rb', line 16 def type @type end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
14 15 16 |
# File 'lib/chart_mogul/import/invoice.rb', line 14 def uuid @uuid end |