module Snowreports

Constants

Snowreport
VERSION

Public Class Methods

all() click to toggle source
# File lib/snowreports.rb, line 13
def self.all
  Endpoint.all.each_with_object([]) do |(_field_name, endpoint), acc|
    response = Fetcher.fetch(snowhq_id: endpoint.snowhq_id)
    acc << Builder.build(xml: response.body, field_id: endpoint.id)
    acc
  end
end
fetch(ski_field) click to toggle source
# File lib/snowreports.rb, line 7
def self.fetch(ski_field)
  endpoint = Endpoint.all.fetch(ski_field)
  response = Fetcher.fetch(snowhq_id: endpoint.snowhq_id)
  Builder.build(xml: response.body, field_id: endpoint.id)
end