Class: SfMobileFoodPermit::Restaurant
- Inherits:
-
Object
- Object
- SfMobileFoodPermit::Restaurant
- Defined in:
- lib/sf_mobile_food_permit.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#applicant ⇒ Object
readonly
Returns the value of attribute applicant.
-
#expiration ⇒ Object
readonly
Returns the value of attribute expiration.
-
#food_items ⇒ Object
readonly
Returns the value of attribute food_items.
-
#permit_number ⇒ Object
readonly
Returns the value of attribute permit_number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Restaurant
constructor
A new instance of Restaurant.
Constructor Details
#initialize(hash) ⇒ Restaurant
Returns a new instance of Restaurant.
9 10 11 12 13 14 15 |
# 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 |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
7 8 9 |
# File 'lib/sf_mobile_food_permit.rb', line 7 def address @address end |
#applicant ⇒ Object (readonly)
Returns the value of attribute applicant.
7 8 9 |
# File 'lib/sf_mobile_food_permit.rb', line 7 def applicant @applicant end |
#expiration ⇒ Object (readonly)
Returns the value of attribute expiration.
7 8 9 |
# File 'lib/sf_mobile_food_permit.rb', line 7 def expiration @expiration end |
#food_items ⇒ Object (readonly)
Returns the value of attribute food_items.
7 8 9 |
# File 'lib/sf_mobile_food_permit.rb', line 7 def food_items @food_items end |
#permit_number ⇒ Object (readonly)
Returns the value of attribute permit_number.
7 8 9 |
# File 'lib/sf_mobile_food_permit.rb', line 7 def permit_number @permit_number end |
Class Method Details
.all ⇒ Object
17 18 19 20 21 22 23 24 25 |
# 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 |