Class: JpxIndustryCode::Category
- Inherits:
-
Object
- Object
- JpxIndustryCode::Category
- Defined in:
- lib/jpx_industry_code/category.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jpx_industry_code/category.rb', line 6 def all [ { id: 1, name: '水産・農林業' }, { id: 2, name: '鉱業' }, { id: 3, name: '建設業' }, { id: 4, name: '製造業' }, { id: 5, name: '電気・ガス業' }, { id: 6, name: '運輸・情報通信業' }, { id: 7, name: '商業' }, { id: 8, name: '金融・保険業' }, { id: 9, name: '不動産業' }, { id: 10, name: 'サービス業' } ] end |
.find_by(find_option) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/jpx_industry_code/category.rb', line 29 def find_by(find_option) return nil unless validate_find_option(find_option) all.find do |jpx_industry_code_category| jpx_industry_code_category[find_option.flatten[0]] == find_option.flatten[1] end end |
.find_by!(find_option) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/jpx_industry_code/category.rb', line 21 def find_by!(find_option) validate_find_option!(find_option) all.find(raise_not_found) do |jpx_industry_code_category| jpx_industry_code_category[find_option.flatten[0]] == find_option.flatten[1] end end |