Class: CorreiosSigep::Models::Recipient

Inherits:
Object
  • Object
show all
Defined in:
lib/correios_sigep/models/recipient.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Recipient

Returns a new instance of Recipient.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/correios_sigep/models/recipient.rb', line 14

def initialize(options = {})
  @address      = options[:address]
  @area_code    = options[:area_code]
  @city         = options[:city]
  @complement   = options[:complement]
  @email        = options[:email]
  @name         = options[:name]
  @neighborhood = options[:neighborhood]
  @number       = options[:number]
  @phone        = options[:phone]
  @postal_code  = options[:postal_code]
  @reference    = options[:reference]
  @state        = options[:state]
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def address
  @address
end

#area_codeObject

Returns the value of attribute area_code.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def area_code
  @area_code
end

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def city
  @city
end

#complementObject

Returns the value of attribute complement.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def complement
  @complement
end

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def email
  @email
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def name
  @name
end

#neighborhoodObject

Returns the value of attribute neighborhood.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def neighborhood
  @neighborhood
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def number
  @number
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def phone
  @phone
end

#postal_codeObject

Returns the value of attribute postal_code.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def postal_code
  @postal_code
end

#referenceObject

Returns the value of attribute reference.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def reference
  @reference
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/correios_sigep/models/recipient.rb', line 4

def state
  @state
end

Class Method Details

.build(&block) ⇒ Object



8
9
10
11
12
# File 'lib/correios_sigep/models/recipient.rb', line 8

def self.build(&block)
  builder = Builders::Person.new(self)
  builder.instance_eval(&block)
  builder.build
end