Class: Location::Services::StubbedService

Inherits:
Object
  • Object
show all
Defined in:
lib/location/services/stubbed_service.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.attributesObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/location/services/stubbed_service.rb', line 8

def self.attributes
  @attributes || {
    address:    'R. Barata Ribeiro',
    number:     '1981',
    complement: '',
    district:   'Copacabana',
    city:       'Rio de Janeiro',
    state:      'RJ'
  }
end

Instance Method Details

#fetch(postal_code, address) ⇒ Object



19
20
21
22
23
# File 'lib/location/services/stubbed_service.rb', line 19

def fetch(postal_code, address)
  StubbedService.attributes.each do |k, v|
    address.send("#{k}=", v)
  end
end