Class: BrewerySearch::Brewery

Inherits:
Object
  • Object
show all
Defined in:
lib/brewery_search/brewery.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBrewery

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

#addressObject

Returns the value of attribute address.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def address
  @address
end

#cityObject

Returns the value of attribute city.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def city
  @city
end

#facebookObject

Returns the value of attribute facebook.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def facebook
  @facebook
end

#instagramObject

Returns the value of attribute instagram.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def instagram
  @instagram
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def name
  @name
end

#overviewObject

Returns the value of attribute overview.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def overview
  @overview
end

#phoneObject

Returns the value of attribute phone.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def phone
  @phone
end

#site_urlObject

Returns the value of attribute site_url.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def site_url
  @site_url
end

#stateObject

Returns the value of attribute state.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def state
  @state
end

#twitterObject

Returns the value of attribute twitter.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def twitter
  @twitter
end

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def type
  @type
end

#websiteObject

Returns the value of attribute website.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def website
  @website
end

#youtubeObject

Returns the value of attribute youtube.



2
3
4
# File 'lib/brewery_search/brewery.rb', line 2

def youtube
  @youtube
end

Class Method Details

.allObject



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