class SfMobileFoodPermit::Restaurant
Attributes
address[R]
applicant[R]
expiration[R]
food_items[R]
permit_number[R]
Public Class Methods
all()
click to toggle source
# File lib/sf_mobile_food_permit.rb, line 17 def self.all restaurants_array = Unirest.get("https://data.sfgov.org/resource/6a9r-agq8.json").body restaurants = [] restaurants_array.each do |restaurant_hash| restaurants << Restaurant.new(restaurant_hash) end return restaurants end
new(hash)
click to toggle source
# File lib/sf_mobile_food_permit.rb, line 9 def initialize(hash) @applicant = hash["applicant"] @address = hash["address"] @food_items = hash["fooditems"] @permit_number = hash["permit"] @expiration = hash["expirationdate"] end