Class: Industry

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
Earth::Base
Defined in:
lib/earth/industry/industry.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Earth::Base

define_schema

Class Method Details

.schema_definitionObject



13
14
15
16
17
18
# File 'lib/earth/industry/industry.rb', line 13

def self.schema_definition
  lambda do
    string 'naics_code'
    string 'description'
  end
end

Instance Method Details

#trade_industry?Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/earth/industry/industry.rb', line 24

def trade_industry?
  prefix = naics_code.to_s[0,2]
  %w{42 44 45}.include?(prefix)
end