Module: Travlrmap::Util
- Defined in:
- lib/travlrmap/util.rb
Class Method Summary collapse
- .domain_from_url(url) ⇒ Object
- .kml_style_url(key, type) ⇒ Object
- .point_from_json(json, types) ⇒ Object
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 |