Class: Hithorizons::Country
- Inherits:
-
Object
- Object
- Hithorizons::Country
- Defined in:
- lib/hithorizons/country.rb
Instance Attribute Summary collapse
-
#invoicing_api ⇒ Object
readonly
Returns the value of attribute invoicing_api.
-
#iso2 ⇒ Object
readonly
Returns the value of attribute iso2.
-
#iso3 ⇒ Object
readonly
Returns the value of attribute iso3.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(iso3, name, registration_number: false, iso2: nil, tax_id: false, vat_id: false, invoicing_api: false) ⇒ Country
constructor
A new instance of Country.
- #invoicing_api? ⇒ Boolean
- #registration_number(company) ⇒ Object
- #registration_number? ⇒ Boolean
- #tax_id(company) ⇒ Object
- #tax_id? ⇒ Boolean
- #vat_id(company) ⇒ Object
- #vat_id? ⇒ Boolean
Constructor Details
#initialize(iso3, name, registration_number: false, iso2: nil, tax_id: false, vat_id: false, invoicing_api: false) ⇒ Country
Returns a new instance of Country.
7 8 9 10 11 12 13 14 15 |
# File 'lib/hithorizons/country.rb', line 7 def initialize(iso3, name, registration_number: false, iso2: nil, tax_id: false, vat_id: false, invoicing_api: false) @iso3 = iso3 @iso2 = iso2 @name = name @registration_number = registration_number @tax_id = tax_id @vat_id = vat_id @invoicing_api = invoicing_api end |
Instance Attribute Details
#invoicing_api ⇒ Object (readonly)
Returns the value of attribute invoicing_api.
5 6 7 |
# File 'lib/hithorizons/country.rb', line 5 def invoicing_api @invoicing_api end |
#iso2 ⇒ Object (readonly)
Returns the value of attribute iso2.
5 6 7 |
# File 'lib/hithorizons/country.rb', line 5 def iso2 @iso2 end |
#iso3 ⇒ Object (readonly)
Returns the value of attribute iso3.
5 6 7 |
# File 'lib/hithorizons/country.rb', line 5 def iso3 @iso3 end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/hithorizons/country.rb', line 5 def name @name end |
Instance Method Details
#invoicing_api? ⇒ Boolean
17 18 19 |
# File 'lib/hithorizons/country.rb', line 17 def invoicing_api? @invoicing_api end |
#registration_number(company) ⇒ Object
45 46 47 48 49 |
# File 'lib/hithorizons/country.rb', line 45 def registration_number(company) return unless registration_number? company['NationalId'] end |
#registration_number? ⇒ Boolean
29 30 31 |
# File 'lib/hithorizons/country.rb', line 29 def registration_number? @registration_number end |
#tax_id(company) ⇒ Object
39 40 41 42 43 |
# File 'lib/hithorizons/country.rb', line 39 def tax_id(company) return unless tax_id? company['NationalId'] end |
#tax_id? ⇒ Boolean
25 26 27 |
# File 'lib/hithorizons/country.rb', line 25 def tax_id? @tax_id end |
#vat_id(company) ⇒ Object
33 34 35 36 37 |
# File 'lib/hithorizons/country.rb', line 33 def vat_id(company) return unless vat_id? company['NationalId'] end |
#vat_id? ⇒ Boolean
21 22 23 |
# File 'lib/hithorizons/country.rb', line 21 def vat_id? @vat_id end |