Class: NjFishingReport::Fishing_Location

Inherits:
Object
  • Object
show all
Defined in:
lib/nj_fishing_report/fishing_location.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Fishing_Location

Returns a new instance of Fishing_Location.



7
8
9
10
# File 'lib/nj_fishing_report/fishing_location.rb', line 7

def initialize(name)
  @name = name
  @@all << self
end

Instance Attribute Details

#fishing_reportObject

Returns the value of attribute fishing_report.



4
5
6
# File 'lib/nj_fishing_report/fishing_location.rb', line 4

def fishing_report
  @fishing_report
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/nj_fishing_report/fishing_location.rb', line 4

def name
  @name
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/nj_fishing_report/fishing_location.rb', line 4

def url
  @url
end

Class Method Details

.allObject



12
13
14
# File 'lib/nj_fishing_report/fishing_location.rb', line 12

def self.all
  @@all
end

.find_by_name(name) ⇒ Object



16
17
18
# File 'lib/nj_fishing_report/fishing_location.rb', line 16

def self.find_by_name(name)
  self.all.detect {|instance| instance.name == name}
end