class GetStation::Stations

Attributes

endpoint_url[R]
latitude[W]
longitude[W]

Public Class Methods

new(args) click to toggle source
# File lib/farmsense_wrapper/stations.rb, line 9
def initialize(args)
  @latitude = args[:latitude]
  @longitude = args[:longitude]
  @endpoint_url = "http://farmsense-prod.apigee.net/v1/frostdates/stations/?lat=#{@latitude}8&lon=#{@longitude}"
end

Public Instance Methods

display() click to toggle source
# File lib/farmsense_wrapper/stations.rb, line 15
def display
  get
  @parsed_response
end
get() click to toggle source
# File lib/farmsense_wrapper/stations.rb, line 20
def get
 raw = HTTParty.get(endpoint_url)
 @parsed_response = parse(raw)
end
parse(data) click to toggle source
# File lib/farmsense_wrapper/stations.rb, line 25
def parse(data)
  JSON.parse(data)
end