Class: BrewerySearch::Brewery
- Inherits:
-
Object
- Object
- BrewerySearch::Brewery
- Defined in:
- lib/brewery_search/brewery.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#city ⇒ Object
Returns the value of attribute city.
-
#facebook ⇒ Object
Returns the value of attribute facebook.
-
#instagram ⇒ Object
Returns the value of attribute instagram.
-
#name ⇒ Object
Returns the value of attribute name.
-
#overview ⇒ Object
Returns the value of attribute overview.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#site_url ⇒ Object
Returns the value of attribute site_url.
-
#state ⇒ Object
Returns the value of attribute state.
-
#twitter ⇒ Object
Returns the value of attribute twitter.
-
#type ⇒ Object
Returns the value of attribute type.
-
#website ⇒ Object
Returns the value of attribute website.
-
#youtube ⇒ Object
Returns the value of attribute youtube.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Brewery
constructor
A new instance of Brewery.
Constructor Details
#initialize ⇒ Brewery
Returns a new instance of Brewery.
6 7 8 |
# File 'lib/brewery_search/brewery.rb', line 6 def initialize @@all << self end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def city @city end |
#facebook ⇒ Object
Returns the value of attribute facebook.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def facebook @facebook end |
#instagram ⇒ Object
Returns the value of attribute instagram.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def instagram @instagram end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def name @name end |
#overview ⇒ Object
Returns the value of attribute overview.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def overview @overview end |
#phone ⇒ Object
Returns the value of attribute phone.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def phone @phone end |
#site_url ⇒ Object
Returns the value of attribute site_url.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def site_url @site_url end |
#state ⇒ Object
Returns the value of attribute state.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def state @state end |
#twitter ⇒ Object
Returns the value of attribute twitter.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def twitter @twitter end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def type @type end |
#website ⇒ Object
Returns the value of attribute website.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def website @website end |
#youtube ⇒ Object
Returns the value of attribute youtube.
2 3 4 |
# File 'lib/brewery_search/brewery.rb', line 2 def youtube @youtube end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/brewery_search/brewery.rb', line 18 def self.all @@all end |
.find_by_city(city_input) ⇒ Object
14 15 16 |
# File 'lib/brewery_search/brewery.rb', line 14 def self.find_by_city(city_input) self.all.select {|entry| entry.city == city_input} end |
.find_by_state(state_input) ⇒ Object
10 11 12 |
# File 'lib/brewery_search/brewery.rb', line 10 def self.find_by_state(state_input) self.all.select {|entry| entry.state == state_input} end |