Class: EgovUtils::Organization
- Defined in:
- app/resources/egov_utils/organization.rb
Class Method Summary collapse
- .courts(organization_keys = nil) ⇒ Object
- .district_courts(superior_ids = nil) ⇒ Object
- .find_by_key(key) ⇒ Object
- .region_courts(branches = false) ⇒ Object
Methods inherited from Love
Class Method Details
.courts(organization_keys = nil) ⇒ Object
8 9 10 11 12 |
# File 'app/resources/egov_utils/organization.rb', line 8 def self.courts(organization_keys=nil) filters = {category_abbrev: ['OS','KS', 'MS']} filters.merge!(key: organization_keys) if organization_keys.present? all(params: {f: filters, sort: {'0' => {path: 'category_abbrev'} }}) end |
.district_courts(superior_ids = nil) ⇒ Object
18 19 20 21 |
# File 'app/resources/egov_utils/organization.rb', line 18 def self.district_courts(superior_ids=nil) f = superior_ids ? {superior_id: superior_ids} : {} all(params: {f: f.merge({category_abbrev: '=|OS'}), sort: {'0' => {path: 'name'} }}) end |
.find_by_key(key) ⇒ Object
4 5 6 |
# File 'app/resources/egov_utils/organization.rb', line 4 def self.find_by_key(key) where(key: key).first end |
.region_courts(branches = false) ⇒ Object
14 15 16 |
# File 'app/resources/egov_utils/organization.rb', line 14 def self.region_courts(branches=false) all(params: {f: {category_abbrev: ['KS','MS'], branch_of_id: [nil]}, sort: {'0' => {path: 'name'} }}) end |