Sha256: a0bf1cf037dba34e51aec274101fc8945a98729f14f9097fc0ba055d437f2c7c

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

require 'donors_choose/version'
require 'donors_choose/request'
require 'json'
require 'ostruct'

module DonorsChoose
  extend self
  attr_accessor :api_key

  def projects_near_me(latitude, longitude)
    request = Request.new(:centerLat => latitude, :centerLong => longitude)
    data = JSON.parse(request.fetch)["proposals"]

    data.collect {|datum| OpenStruct.new(datum)}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
donors_choose-0.0.4 lib/donors_choose.rb