Class: EndangeredSpecies::Articles

Inherits:
Object
  • Object
show all
Defined in:
lib/endangered_species/articles.rb

Overview

Stores data on all Articles

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date.



4
5
6
# File 'lib/endangered_species/articles.rb', line 4

def date
  @date
end

#summaryObject

Returns the value of attribute summary.



4
5
6
# File 'lib/endangered_species/articles.rb', line 4

def summary
  @summary
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/endangered_species/articles.rb', line 4

def title
  @title
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/endangered_species/articles.rb', line 4

def url
  @url
end

Class Method Details

.allObject

class reader to expose @@all class variable



8
9
10
# File 'lib/endangered_species/articles.rb', line 8

def self.all #class reader to expose @@all class variable
  @@all
end

Instance Method Details

#saveObject



12
13
14
# File 'lib/endangered_species/articles.rb', line 12

def save
  @@all << self
end