Class: EgovUtils::Organization
- Inherits:
-
Love
- Object
- ActiveResource::Base
- Love
- EgovUtils::Organization
show all
- Defined in:
- app/resources/egov_utils/organization.rb
Class Method Summary
collapse
Methods inherited from Love
config, inherited, mock!, mock_subclass, mocked_classes, where
Class Method Details
.courts(organization_keys = nil) ⇒ Object
37
38
39
40
41
|
# File 'app/resources/egov_utils/organization.rb', line 37
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
47
48
49
50
|
# File 'app/resources/egov_utils/organization.rb', line 47
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
33
34
35
|
# File 'app/resources/egov_utils/organization.rb', line 33
def self.find_by_key(key)
where(key: key).first
end
|
.region_courts(branches = false) ⇒ Object
43
44
45
|
# File 'app/resources/egov_utils/organization.rb', line 43
def self.region_courts(branches=false)
all(params: {f: {category_abbrev: ['KS','MS'], branch_of_id: [nil]}, sort: {'0' => {path: 'name'} }})
end
|