class Formater

Attributes

city[R]
state[R]

Public Class Methods

new(city, state) click to toggle source
# File lib/formater.rb, line 4
def initialize city, state
        @city = city
        @state = state
end

Public Instance Methods

create_state_city_string() click to toggle source
# File lib/formater.rb, line 9
def create_state_city_string
        "#{format_state(@state)}/#{format_city(@city)}"
end

Private Instance Methods

format_city(city) click to toggle source
# File lib/formater.rb, line 20
def format_city city
        if city.length > 1
                fcity = city.split(" ")
                fcity.map(&:capitalize).join(" ").gsub(" ", "_")
        else
                city
        end
end
format_state(state) click to toggle source
# File lib/formater.rb, line 15
def format_state state
        state_city = ""
        state = state.upcase
end