Class: TopCompanies::Sector

Inherits:
Object
  • Object
show all
Defined in:
lib/top_companies/sector.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Sector

Returns a new instance of Sector.



6
7
8
9
# File 'lib/top_companies/sector.rb', line 6

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/top_companies/sector.rb', line 2

def name
  @name
end

Class Method Details

.allObject



11
12
13
# File 'lib/top_companies/sector.rb', line 11

def self.all
    @@all
end