class Addressy::Address

Attributes

city[R]
country[R]
street[R]

Public Class Methods

new(info) click to toggle source
# File lib/addressy.rb, line 19
def initialize(info)
  @street = info.fetch("Address")
  @city = info.fetch("City")
  @state = info.fetch("State")
  @zip = info.fetch("Zip")
  @country = info.fetch("Country")
end

Public Instance Methods

full() click to toggle source
# File lib/addressy.rb, line 35
def full
  "#{@street}, #{@city}, #{@state} #{@zip}, #{@country}"
end
Also aliased as: to_s
state(name = false) click to toggle source
# File lib/addressy.rb, line 27
def state(name = false)
  name ? ::Addressy::US::Helper::STATES[@state] : @state
end
to_s()
Alias for: full
zip(simple = false) click to toggle source
# File lib/addressy.rb, line 31
def zip(simple = false)
  simple ? @zip[0..4] : @zip
end