class Location
Class Location
represents structure of location:
location = Location.new location.countryRank # => Integer location.country # => String location.cityRank # => Integer location.city # => String location.stateCode # => String location.stateName # => String location.code # => String location.latitude # => Float location.longitude # => Float location.from_array(array) # => Array of Location objects
Public Class Methods
from_array(array)
click to toggle source
Method from_array
returns array of locations(create from json). Takes value of array objects as json parameter array.
Example:
Location.from_array([...array of JSON objects...]) # => Array of Location
# File lib/models/location.rb, line 25 def self.from_array(array) array.collect do |element| Location.new(element) end end