Class: Facturae::Address

Inherits:
Object
  • Object
show all
Includes:
Validatable
Defined in:
lib/facturae/models/address.rb

Overview

Represents an address.

Constant Summary collapse

ESP_CC =
"ESP"
COUNTRY_CODES =
%w[AUT BEL BGR CYP CZE DEU DNK ESP EST
FIN FRA GRC HRV HUN IRL ITA LTU LUX
LVA MLT NLD POL PRT ROU SVK SVN SWE].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#errors, #valid?

Constructor Details

#initialize(address:, post_code:, province:, country_code:, town: nil) ⇒ Address

Returns a new instance of Address.



24
25
26
27
28
29
30
# File 'lib/facturae/models/address.rb', line 24

def initialize(address:, post_code:, province:, country_code:, town: nil)
  @address      = address
  @post_code    = post_code
  @town         = town
  @province     = province
  @country_code = country_code
end

Instance Attribute Details

#addressString

The address.

Returns:

  • (String)

    the current value of address



10
11
12
# File 'lib/facturae/models/address.rb', line 10

def address
  @address
end

#country_codeString

The country code.

Returns:

  • (String)

    the current value of country_code



10
11
12
# File 'lib/facturae/models/address.rb', line 10

def country_code
  @country_code
end

#post_codeString

The post code.

Returns:

  • (String)

    the current value of post_code



10
11
12
# File 'lib/facturae/models/address.rb', line 10

def post_code
  @post_code
end

#provinceString

The province.

Returns:

  • (String)

    the current value of province



10
11
12
# File 'lib/facturae/models/address.rb', line 10

def province
  @province
end

#townString

The town.

Returns:

  • (String)

    the current value of town



10
11
12
# File 'lib/facturae/models/address.rb', line 10

def town
  @town
end