Class: PagSeguro::Address

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/pagseguro/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Address

Returns a new instance of Address.



35
36
37
38
39
40
41
42
43
44
# File 'lib/pagseguro/address.rb', line 35

def initialize(options = {})
  @country = "BRA"
  @postal_code = options[:postal_code]
  @street = options[:street]
  @number = options[:number]
  @complement = options[:complement]
  @district = options[:district]
  @city = options[:city]
  @state = options[:state]
end

Instance Attribute Details

#cityObject

Get the city.



27
28
29
# File 'lib/pagseguro/address.rb', line 27

def city
  @city
end

#complementObject

Get the complement.



21
22
23
# File 'lib/pagseguro/address.rb', line 21

def complement
  @complement
end

#countryObject

Get the country.



33
34
35
# File 'lib/pagseguro/address.rb', line 33

def country
  @country
end

#districtObject

Get the district.



24
25
26
# File 'lib/pagseguro/address.rb', line 24

def district
  @district
end

#numberObject

Set the number.



18
19
20
# File 'lib/pagseguro/address.rb', line 18

def number
  @number
end

#postal_codeObject

Set the postal_code. 8 digit number represeting a valid CEP i.e 01452002



12
13
14
# File 'lib/pagseguro/address.rb', line 12

def postal_code
  @postal_code
end

#stateObject

Get the state.



30
31
32
# File 'lib/pagseguro/address.rb', line 30

def state
  @state
end

#streetObject

Set the street name.



15
16
17
# File 'lib/pagseguro/address.rb', line 15

def street
  @street
end