Class: BestCompanies::Industry

Inherits:
Object
  • Object
show all
Extended by:
Findable::ClassMethods, Nameable::ClassMethods, Persistable::ClassMethods
Includes:
Persistable::InstanceMethods
Defined in:
lib/best_companies/industry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Nameable::ClassMethods

create

Methods included from Findable::ClassMethods

find_by_name, find_or_create_by_name

Methods included from Persistable::ClassMethods

check_input, extended, list

Methods included from Persistable::InstanceMethods

#add_company, #save

Constructor Details

#initialize(name) ⇒ Industry

Returns a new instance of Industry.



10
11
12
13
# File 'lib/best_companies/industry.rb', line 10

def initialize(name)
 @name = name
 @companies = []
end

Instance Attribute Details

#companiesObject (readonly)

Returns the value of attribute companies.



8
9
10
# File 'lib/best_companies/industry.rb', line 8

def companies
  @companies
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/best_companies/industry.rb', line 7

def name
  @name
end

Class Method Details

.allObject



15
16
17
# File 'lib/best_companies/industry.rb', line 15

def self.all
 @@all
end