Class: Industry
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Industry
- Extended by:
- Earth::Model
- Defined in:
- lib/earth/industry/industry.rb
Overview
TODO replace this with NAICS 2002?
Constant Summary collapse
- TABLE_STRUCTURE =
<<-EOS CREATE TABLE industries ( naics_code CHARACTER VARYING(255) NOT NULL PRIMARY KEY, description CHARACTER VARYING(255) ); EOS
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Earth::Model
extend_mining, extended, registry
Class Method Details
.format_naics_code(input) ⇒ Object
34 35 36 |
# File 'lib/earth/industry/industry.rb', line 34 def format_naics_code(input) "%d" % input.to_i end |
Instance Method Details
#trade_industry? ⇒ Boolean
39 40 41 42 |
# File 'lib/earth/industry/industry.rb', line 39 def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include? prefix end |