Class: EgovUtils::OrganizationMock

Inherits:
LoveMock
  • Object
show all
Defined in:
app/resources/egov_utils/organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LoveMock

where

Class Method Details

.all(*attrs) ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/resources/egov_utils/organization.rb', line 3

def self.all(*attrs)
  [
    new(id: 1, name: 'Městský soud 1', key: '104000', category_abbrev: 'MS' ),
    new(id: 2, name: 'Krajský soud 1', key: '204000', category_abbrev: 'KS' ),
    new(id: 3, name: 'Krajský soud 2', key: '205000', category_abbrev: 'KS' ),
    new(id: 13, name: 'Okresní soud 1', key: '204001', category_abbrev: 'OS' )
  ]
end

.find_by_key(key) ⇒ Object



12
13
14
# File 'app/resources/egov_utils/organization.rb', line 12

def self.find_by_key(key)
  all.detect{ |o| o.key == key }
end

.region_courts(branches = false) ⇒ Object



16
17
18
# File 'app/resources/egov_utils/organization.rb', line 16

def self.region_courts(branches=false)
  all.select{ |o| %w{KS MS}.include?(o.category_abbrev) }
end

Instance Method Details

#branch_of_idObject



20
# File 'app/resources/egov_utils/organization.rb', line 20

def branch_of_id; end