Sha256: 3b287e9ca8e3bec0a92a12c3d0dfd8c1ff8fb4ad90161ae42b91dbf030f45408

Contents?: true

Size: 618 Bytes

Versions: 8

Compression:

Stored size: 618 Bytes

Contents

module Firstfm
  
  class Location
    
    attr_accessor :city, :country, :postalcode, :lat, :long, :street
    
    def self.init_location_from_hash(hash)
      return nil unless hash.is_a?(Hash)
      
      location = Location.new
      location.city         = hash["city"]
      location.country      = hash["country"]
      location.postalcode   = hash["postalcode"]
      location.street       = hash["street"]
      location.lat          = hash["geo:point"]["geo:lat"] if hash["geo:point"]
      location.long         = hash["geo:point"]["geo:lat"] if hash["geo:point"]
      location
    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
firstfm-0.2.2 lib/firstfm/location.rb
firstfm-0.2.1 lib/firstfm/location.rb
firstfm-0.2.0 lib/firstfm/location.rb
firstfm-0.1.2 lib/firstfm/location.rb
firstfm-0.1.1 lib/firstfm/location.rb
firstfm-0.1.0 lib/firstfm/location.rb
firstfm-0.0.2 lib/firstfm/location.rb
firstfm-0.0.1 lib/firstfm/location.rb