Sha256: 3cf4dd137e16560300f63a761f7e10e4cc69aedea1a696f4a168071d23a8111a

Contents?: true

Size: 933 Bytes

Versions: 16

Compression:

Stored size: 933 Bytes

Contents

# 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
#
class Location < Struct.new(:countryRank, :country, :cityRank, :city, :stateCode, :stateName, :code, :latitude, :longitude)

  # 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
  #
  def self.from_array(array)
    array.collect do |element|
      Location.new(element)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 lib/models/location.rb
threetaps-client-1.0.13 lib/models/location.rb
threetaps-client-1.0.12 lib/models/location.rb
threetaps-client-1.0.11 lib/models/location.rb
threetaps-client-1.0.10 lib/models/location.rb
threetaps-client-1.0.9 lib/models/location.rb
threetaps-client-1.0.8 lib/models/location.rb
threetaps-client-1.0.7 lib/models/location.rb
threetaps-client-1.0.6 lib/models/location.rb
threetaps-client-1.0.5 lib/models/location.rb
threetaps-client-1.0.4 lib/models/location.rb
threetaps-client-1.0.3 lib/models/location.rb
threetaps-client-1.0.2 lib/models/location.rb
threetaps-client-1.0.1 lib/models/location.rb
threetaps-client-1.0.0 lib/models/location.rb
threetaps-client-0.5.1 lib/models/location.rb