Class: ChartMogul::Import::Invoice::LineItem

Inherits:
Object
  • Object
show all
Defined in:
lib/chart_mogul/import/invoice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_centsObject (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_centsObject (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_codeObject (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_idObject (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_uuidObject (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

#proratedObject (readonly)

Returns the value of attribute prorated.



19
20
21
# File 'lib/chart_mogul/import/invoice.rb', line 19

def prorated
  @prorated
end

#quantityObject (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_endObject (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_startObject (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_uuidObject (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_centsObject (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

#typeObject (readonly)

Returns the value of attribute type.



16
17
18
# File 'lib/chart_mogul/import/invoice.rb', line 16

def type
  @type
end

#uuidObject (readonly)

Returns the value of attribute uuid.



14
15
16
# File 'lib/chart_mogul/import/invoice.rb', line 14

def uuid
  @uuid
end