Module: Refinery::Retailers::RetailersHelper
- Defined in:
- app/helpers/refinery/retailers/retailers_helper.rb
Instance Method Summary collapse
- #country_name(country_code) ⇒ Object
- #inline_address(retailer) ⇒ Object
- #subregion_name(country_code, state_code) ⇒ Object
Instance Method Details
#country_name(country_code) ⇒ Object
4 5 6 7 |
# File 'app/helpers/refinery/retailers/retailers_helper.rb', line 4 def country_name(country_code) country = Carmen::Country.coded(country_code) country.name unless country.nil? end |
#inline_address(retailer) ⇒ Object
14 15 16 |
# File 'app/helpers/refinery/retailers/retailers_helper.rb', line 14 def inline_address(retailer) [retailer.address, retailer.city, retailer.state_code, retailer.zipcode, country_name(retailer.country_code)].reject(&:blank?).join(", ") end |
#subregion_name(country_code, state_code) ⇒ Object
9 10 11 12 |
# File 'app/helpers/refinery/retailers/retailers_helper.rb', line 9 def subregion_name(country_code, state_code) subregion = Carmen::Country.coded(country_code).subregions.coded(state_code) subregion.name unless subregion.nil? end |