Class: Ziptedu::Zipcode

Inherits:
Object
  • Object
show all
Defined in:
lib/ziptedu/zipcode.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Zipcode

Returns a new instance of Zipcode.

Yields:

  • (_self)

Yield Parameters:



8
9
10
# File 'lib/ziptedu/zipcode.rb', line 8

def initialize
  yield self if block_given?
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



5
6
7
# File 'lib/ziptedu/zipcode.rb', line 5

def city
  @city
end

#latitudeObject

Returns the value of attribute latitude.



5
6
7
# File 'lib/ziptedu/zipcode.rb', line 5

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



5
6
7
# File 'lib/ziptedu/zipcode.rb', line 5

def longitude
  @longitude
end

#stateObject

Returns the value of attribute state.



5
6
7
# File 'lib/ziptedu/zipcode.rb', line 5

def state
  @state
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/ziptedu/zipcode.rb', line 6

def type
  @type
end

#zipcodeObject

Returns the value of attribute zipcode.



5
6
7
# File 'lib/ziptedu/zipcode.rb', line 5

def zipcode
  @zipcode
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/ziptedu/zipcode.rb', line 16

def to_s
  JSON.pretty_generate({ zipcode: zipcode, type: type, city: city, state: state, latitude: latitude, longitude: longitude })
end