class SfAircraftNoiseComplaints::Complaint

Attributes

community[R]
no_of_callers[R]
no_of_complaints[R]
year[R]

Public Class Methods

all() click to toggle source
# File lib/sf_aircraft_noise_complaints.rb, line 16
def self.all
  complaints_array = Unirest.get("https://data.sfgov.org/resource/bw78-hmt5.json").body
  complaints = []
  complaints_array.each do |complaint_hash|
    complaints.push(Complaint.new(complaint_hash))
  end
  return complaints
end
new(hash) click to toggle source
# File lib/sf_aircraft_noise_complaints.rb, line 9
def initialize(hash)
  @community = hash["community"]
  @year = hash["year"]
  @no_of_complaints = hash["total_complaints"]
  @no_of_callers = hash["total_number_of_callers"]
end