Sha256: 245351725960913636f9379f562926433abb2adcccd6f226b397e1dc1d019ba9

Contents?: true

Size: 804 Bytes

Versions: 3

Compression:

Stored size: 804 Bytes

Contents

module OldBill
  module V2
    module Crimes
      class Location < Hashie::Dash
        
      
        property :name	#Name if available
        property :longitude	#Location longitude
        property :latitude	#Location latitude
        property :street	#Location latitude
        
        # id  Unique identifier for the street
        # name  Name of the location.
        # This is only an approximation of where the crime happened
        def street_parsed(value)
          unless value.nil?
            Hashie::Mash.new(value)
          end
        end
        

        def []=(property, value)
          case property 
            when "street"
            super(property.to_s, street_parsed(value))
          else
            super
          end
        end
      
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oldbill-0.0.3 lib/oldbill/v2/crimes/location.rb
oldbill-0.0.2 lib/oldbill/v2/crimes/location.rb
oldbill-0.0.1 lib/oldbill/v2/crimes/location.rb