Class: Facturae::Subject
- Inherits:
-
Object
- Object
- Facturae::Subject
- Includes:
- Validatable
- Defined in:
- lib/facturae/models/subject.rb
Overview
Represents a legal subject, either an individual or a legal entity.
Constant Summary collapse
- INDIVIDUAL =
:individual- LEGAL =
:legal- SUBJECT_TYPES =
[INDIVIDUAL, LEGAL].freeze
Instance Attribute Summary collapse
-
#address_in_spain ⇒ Facturae::Address
The address in Spain.
-
#name_field1 ⇒ String
The first name field.
-
#name_field2 ⇒ String
The second name field.
-
#name_field3 ⇒ Object
Returns the value of attribute name_field3.
-
#overseas_address ⇒ Facturae::Address
The overseas address.
-
#type ⇒ Symbol
The type of subject.
Instance Method Summary collapse
-
#initialize(type:, name_field1:, name_field2: nil, name_field3: nil, address_in_spain: Address.new) ⇒ Subject
constructor
A new instance of Subject.
Methods included from Validatable
Constructor Details
#initialize(type:, name_field1:, name_field2: nil, name_field3: nil, address_in_spain: Address.new) ⇒ Subject
Returns a new instance of Subject.
24 25 26 27 28 29 30 |
# File 'lib/facturae/models/subject.rb', line 24 def initialize(type:, name_field1:, name_field2: nil, name_field3: nil, address_in_spain: Address.new) @type = type @name_field1 = name_field1 @name_field2 = name_field2 @name_field3 = name_field3 @address_in_spain = address_in_spain end |
Instance Attribute Details
#address_in_spain ⇒ Facturae::Address
The address in Spain.
10 11 12 |
# File 'lib/facturae/models/subject.rb', line 10 def address_in_spain @address_in_spain end |
#name_field1 ⇒ String
The first name field.
10 11 12 |
# File 'lib/facturae/models/subject.rb', line 10 def name_field1 @name_field1 end |
#name_field2 ⇒ String
The second name field.
10 11 12 |
# File 'lib/facturae/models/subject.rb', line 10 def name_field2 @name_field2 end |
#name_field3 ⇒ Object
Returns the value of attribute name_field3.
17 18 19 |
# File 'lib/facturae/models/subject.rb', line 17 def name_field3 @name_field3 end |
#overseas_address ⇒ Facturae::Address
The overseas address. Optional.
10 11 12 |
# File 'lib/facturae/models/subject.rb', line 10 def overseas_address @overseas_address end |
#type ⇒ Symbol
The type of subject.
10 11 12 |
# File 'lib/facturae/models/subject.rb', line 10 def type @type end |