class AnmsmRuby::Base

Attributes

resort_svc[RW]

Public Class Methods

new() click to toggle source
# File lib/anmsm_ruby.rb, line 7
def initialize
  # Resort feed
  @resort_svc = OData::Service.new "http://wcf.tourinsoft.com/Syndication/anmsm/817bee9d-faf4-4680-9d05-e41c2c90ae5a", {:namespace => "Anmsm::Resort"}
  # Weather feed
  @weather_svc = OData::Service.new "http://wcf.tourinsoft.com/Syndication/anmsm/fc13de9f-fa6c-45bf-9f25-1f023a3e6db5", {:namespace => "Anmsm::Weather"}
  # Snow feed
  @snow_svc = OData::Service.new "http://wcf.tourinsoft.com/Syndication/anmsm/ce4e4296-6132-4e11-b8db-ea21b92e736c", {:namespace => "Anmsm::Snow"}
end

Public Instance Methods

all_resorts() click to toggle source

returns general info for all resorts

# File lib/anmsm_ruby.rb, line 17
def all_resorts
  @resort_svc.Objects.order_by("NOMSTATION")
  @resort_svc.execute
end
info_for_resort(resort_name) click to toggle source

returns general info for the given resorts

# File lib/anmsm_ruby.rb, line 23
def info_for_resort(resort_name)
  @resort_svc.Objects.filter("NOMSTATION eq '#{resort_name}'")
  @resort_svc.execute
end
snow_info_for_resort(resort) click to toggle source

returns snow info for the given resort

# File lib/anmsm_ruby.rb, line 29
def snow_info_for_resort(resort)
  resort_id = resort.SyndicObjectID
  @snow_svc.Objects.filter("STATION eq '#{resort_id}'").order_by("Updated")
  @snow_svc.execute
end
weather_for_resort(resort) click to toggle source

returns weather info for the given resort

# File lib/anmsm_ruby.rb, line 36
def weather_for_resort(resort)
  resort_id = resort.SyndicObjectID
  @weather_svc.Objects.filter("STATION eq '#{resort_id}'").order_by("day(Updated)")
                                                          .order_by("month(Updated)")
                                                          .order_by("year(Updated)")
  @weather_svc.execute
end