Class: Segurofacil::Estagiario
- Inherits:
-
Object
- Object
- Segurofacil::Estagiario
- Extended by:
- REST::EstagiarioCreate, REST::EstagiarioRemove
- Defined in:
- lib/segurofacil/estagiario.rb
Constant Summary collapse
- NAME =
'nome'
- CPF =
'cPF'
- BIRTHDATE =
'dOB'
- GENDER =
'sexoId'
- MALE =
1
- FEMALE =
2
Constants included from REST::EstagiarioCreate
Constants included from REST::EstagiarioRemove
Instance Attribute Summary collapse
-
#birthdate ⇒ Object
readonly
Returns the value of attribute birthdate.
-
#cpf ⇒ Object
readonly
Returns the value of attribute cpf.
-
#gender ⇒ Object
readonly
Returns the value of attribute gender.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .ary_to_estagiarios(list) ⇒ Object
- .convert_to_estagiario(hash) ⇒ Object
- .create(estagiario, cnpj) ⇒ Object
-
.remove(estagiario_cpf, cnpj) ⇒ Object
Remove a estagiario from the policy.
Instance Method Summary collapse
- #female? ⇒ Boolean
-
#initialize(options) ⇒ Estagiario
constructor
A new instance of Estagiario.
- #male? ⇒ Boolean
Methods included from REST::EstagiarioCreate
Methods included from REST::EstagiarioRemove
Constructor Details
#initialize(options) ⇒ Estagiario
Returns a new instance of Estagiario.
17 18 19 20 21 22 |
# File 'lib/segurofacil/estagiario.rb', line 17 def initialize() @name = .fetch(NAME) @cpf = .fetch(CPF) @birthdate = .fetch(BIRTHDATE) @gender = .fetch(GENDER) end |
Instance Attribute Details
#birthdate ⇒ Object (readonly)
Returns the value of attribute birthdate.
15 16 17 |
# File 'lib/segurofacil/estagiario.rb', line 15 def birthdate @birthdate end |
#cpf ⇒ Object (readonly)
Returns the value of attribute cpf.
15 16 17 |
# File 'lib/segurofacil/estagiario.rb', line 15 def cpf @cpf end |
#gender ⇒ Object (readonly)
Returns the value of attribute gender.
15 16 17 |
# File 'lib/segurofacil/estagiario.rb', line 15 def gender @gender end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/segurofacil/estagiario.rb', line 15 def name @name end |
Class Method Details
.ary_to_estagiarios(list) ⇒ Object
52 53 54 55 |
# File 'lib/segurofacil/estagiario.rb', line 52 def ary_to_estagiarios(list) return [] if list.nil? list.map {|item| convert_to_estagiario(item) } end |
.convert_to_estagiario(hash) ⇒ Object
48 49 50 |
# File 'lib/segurofacil/estagiario.rb', line 48 def convert_to_estagiario(hash) self.new hash end |
.create(estagiario, cnpj) ⇒ Object
34 35 36 37 |
# File 'lib/segurofacil/estagiario.rb', line 34 def create(estagiario, cnpj) res = super estagiario, cnpj get_create_response(res) end |
.remove(estagiario_cpf, cnpj) ⇒ Object
Remove a estagiario from the policy
43 44 45 46 |
# File 'lib/segurofacil/estagiario.rb', line 43 def remove(estagiario_cpf, cnpj) res = super estagiario_cpf, cnpj get_remove_response(res) end |