Module: Travlrmap::Util

Defined in:
lib/travlrmap/util.rb

Class Method Summary collapse

Class Method Details

.domain_from_url(url) ⇒ Object



7
8
9
10
# File 'lib/travlrmap/util.rb', line 7

def self.domain_from_url(url)
  host = URI.parse(url).host.downcase
  host.match(/^(en|www)\./) ? host.split(".")[1..-1].join(".") : host
end

.kml_style_url(key, type) ⇒ Object



3
4
5
# File 'lib/travlrmap/util.rb', line 3

def self.kml_style_url(key, type)
  "travlrmap-%s-%s" % [key, type]
end

.point_from_json(json, types) ⇒ Object



12
13
14
# File 'lib/travlrmap/util.rb', line 12

def self.point_from_json(json, types)
  Point.new(json, types, :json)
end