class PistePal::DataServices::DateAndResort

Public Class Methods

call() click to toggle source
# File lib/piste_pal/data_services/date_and_resort.rb, line 6
def self.call
  new().call
end
new() click to toggle source
# File lib/piste_pal/data_services/date_and_resort.rb, line 19
def initialize
  @doc = PistePal::DataServices::GpxDoc.instance.doc
end

Public Instance Methods

call() click to toggle source
# File lib/piste_pal/data_services/date_and_resort.rb, line 10
def call
  name_node = @doc.xpath("//xmlns:name")
  @date, @resort_name = name_node.children.first.text.strip.split(" - ")
  @date = Time.parse(@date)
  return [@date, @resort_name]
end