Class: Deliveries::Couriers::MondialRelay::Address

Inherits:
Address
  • Object
show all
Defined in:
lib/deliveries/couriers/mondial_relay/address.rb

Constant Summary

Constants inherited from Address

Address::COUNTRY_PHONE_PREFIXES, Address::COUNTRY_TRUNK_PREFIXES

Instance Attribute Summary

Attributes inherited from Address

#address_id, #postcode, #state

Instance Method Summary collapse

Methods inherited from Address

#courierize, #initialize

Constructor Details

This class inherits a constructor from Deliveries::Address

Instance Method Details

#cityObject



13
14
15
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 13

def city
  I18n.transliterate(@city.to_s).gsub(/[^A-Z_\-' ]/i, '').upcase.truncate(25, omission: '')
end

#countryObject



17
18
19
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 17

def country
  @country.to_s.upcase
end

#emailObject



25
26
27
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 25

def email
  format_email
end

#nameObject



5
6
7
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 5

def name
  I18n.transliterate(@name.to_s).gsub(%r{[^0-9A-Z_\-'., /]}i, '').upcase.truncate(32, omission: '')
end

#phoneObject



21
22
23
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 21

def phone
  format_international_phone
end

#streetObject



9
10
11
# File 'lib/deliveries/couriers/mondial_relay/address.rb', line 9

def street
  I18n.transliterate(@street.to_s).gsub(%r{[^0-9A-Z_\-'., /]}i, '').upcase.truncate(32, omission: '')
end