Class: MossGenerator::Stripe
- Inherits:
-
Object
- Object
- MossGenerator::Stripe
- Defined in:
- lib/moss_generator/stripe.rb
Overview
Generate MOSS CSV string from Stripe charges
Defined Under Namespace
Classes: NoTurnoverCountryError
Instance Attribute Summary collapse
-
#charges ⇒ Object
readonly
Returns the value of attribute charges.
-
#period ⇒ Object
readonly
Returns the value of attribute period.
-
#rates ⇒ Object
readonly
Returns the value of attribute rates.
-
#sale_type ⇒ Object
readonly
Returns the value of attribute sale_type.
-
#vat_number ⇒ Object
readonly
Returns the value of attribute vat_number.
-
#vat_rate_service ⇒ Object
readonly
Returns the value of attribute vat_rate_service.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
-
.call(*args) ⇒ Object
rubocop:enable Metrics/ParameterLists.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(charges, vat_number, period, year, rates, sale_type, vat_rate_service = MossGenerator::VatRate) ⇒ Stripe
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(charges, vat_number, period, year, rates, sale_type, vat_rate_service = MossGenerator::VatRate) ⇒ Stripe
rubocop:disable Metrics/ParameterLists
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/moss_generator/stripe.rb', line 15 def initialize(charges, vat_number, period, year, rates, sale_type, vat_rate_service = MossGenerator::VatRate) @charges = charges @vat_number = vat_number @period = period @year = year @rates = rates @sale_type = sale_type @vat_rate_service = vat_rate_service end |
Instance Attribute Details
#charges ⇒ Object (readonly)
Returns the value of attribute charges.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def charges @charges end |
#period ⇒ Object (readonly)
Returns the value of attribute period.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def period @period end |
#rates ⇒ Object (readonly)
Returns the value of attribute rates.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def rates @rates end |
#sale_type ⇒ Object (readonly)
Returns the value of attribute sale_type.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def sale_type @sale_type end |
#vat_number ⇒ Object (readonly)
Returns the value of attribute vat_number.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def vat_number @vat_number end |
#vat_rate_service ⇒ Object (readonly)
Returns the value of attribute vat_rate_service.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def vat_rate_service @vat_rate_service end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
11 12 13 |
# File 'lib/moss_generator/stripe.rb', line 11 def year @year end |
Class Method Details
.call(*args) ⇒ Object
rubocop:enable Metrics/ParameterLists
32 33 34 |
# File 'lib/moss_generator/stripe.rb', line 32 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/moss_generator/stripe.rb', line 36 def call CSV.generate(**) do |csv| csv << first_row csv << second_row generate_charges_rows(csv) end end |