Class: STP::Structs::Account
- Inherits:
-
Object
- Object
- STP::Structs::Account
- Defined in:
- lib/stp/structs/account.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
cuenta.
-
#birthdate ⇒ Object
cuenta.
-
#company ⇒ Object
cuenta.
-
#country ⇒ Object
cuenta.
-
#economic_activity ⇒ Object
cuenta.
-
#email ⇒ Object
cuenta.
-
#exterior_number ⇒ Object
cuenta.
-
#identification_id ⇒ Object
cuenta.
-
#interior_number ⇒ Object
cuenta.
-
#maternal_surname ⇒ Object
cuenta.
-
#municipality ⇒ Object
cuenta.
-
#name ⇒ Object
cuenta.
-
#neighborhood ⇒ Object
cuenta.
-
#paternal_surname ⇒ Object
cuenta.
-
#phone ⇒ Object
cuenta.
-
#rfc ⇒ Object
cuenta.
-
#sex ⇒ Object
cuenta.
-
#signature ⇒ Object
cuenta.
-
#state ⇒ Object
cuenta.
-
#street ⇒ Object
cuenta.
-
#zip_code ⇒ Object
cuenta.
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
-
#initialize ⇒ Account
constructor
A new instance of Account.
- #original_chain ⇒ Object
- #to_json(*options) ⇒ Object
Constructor Details
Instance Attribute Details
#account ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def account @account end |
#birthdate ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def birthdate @birthdate end |
#company ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def company @company end |
#country ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def country @country end |
#economic_activity ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def economic_activity @economic_activity end |
#email ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def email @email end |
#exterior_number ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def exterior_number @exterior_number end |
#identification_id ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def identification_id @identification_id end |
#interior_number ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def interior_number @interior_number end |
#maternal_surname ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def maternal_surname @maternal_surname end |
#municipality ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def municipality @municipality end |
#name ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def name @name end |
#neighborhood ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def neighborhood @neighborhood end |
#paternal_surname ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def paternal_surname @paternal_surname end |
#phone ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def phone @phone end |
#rfc ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def rfc @rfc end |
#sex ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def sex @sex end |
#signature ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def signature @signature end |
#state ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def state @state end |
#street ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def street @street end |
#zip_code ⇒ Object
cuenta
4 5 6 |
# File 'lib/stp/structs/account.rb', line 4 def zip_code @zip_code end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/stp/structs/account.rb', line 36 def as_json( = {}) name = @name.present? ? I18n.transliterate(@name) : nil paternal_surname = @paternal_surname.present? ? I18n.transliterate(@paternal_surname) : nil maternal_surname = @maternal_surname.present? ? I18n.transliterate(@maternal_surname) : nil { cuenta: @account, empresa: @company, nombre: name, apellidoPaterno: paternal_surname, apellidoMaterno: maternal_surname, rfcCurp: @rfc, fechaNacimiento: @birthdate, genero: @sex, entidadFederativa: @state, actividadEconomica: @economic_activity, calle: @street, numExterior: @exterior_number, numInterior: @interior_number, colonia: @neighborhood, alcaldiaMunicipio: @municipality, codigoPostal: @zip_code, paisNacimiento: @country, email: @email, idIdentificacion: @identification_id, telefono: @phone, firma: @signature, }.compact end |
#original_chain ⇒ Object
30 31 32 33 34 |
# File 'lib/stp/structs/account.rb', line 30 def original_chain "||#{@company}|"\ "#{@account}|"\ "#{@rfc}||" end |
#to_json(*options) ⇒ Object
65 66 67 |
# File 'lib/stp/structs/account.rb', line 65 def to_json(*) as_json(*).to_json(*) end |