Class: Meibo::OrganizationSet

Inherits:
DataSet
  • Object
show all
Defined in:
lib/meibo/organization_set.rb

Direct Known Subclasses

JapanProfile::OrganizationSet

Instance Attribute Summary

Attributes inherited from DataSet

#roster

Instance Method Summary collapse

Methods inherited from DataSet

#<<, #each, #empty?, #find, #initialize, #lineno, #where

Constructor Details

This class inherits a constructor from Meibo::DataSet

Instance Method Details

#check_semantically_consistentObject



5
6
7
8
9
10
11
12
13
# File 'lib/meibo/organization_set.rb', line 5

def check_semantically_consistent
  super

  each do |organization|
    next unless organization.parent_sourced_id

    find(organization.parent_sourced_id)
  end
end

#departmentObject



15
16
17
# File 'lib/meibo/organization_set.rb', line 15

def department
  @cache[:department] ||= new(select(&:department?))
end

#districtObject



23
24
25
# File 'lib/meibo/organization_set.rb', line 23

def district
  @cache[:district] ||= new(select(&:district?))
end

#localObject



27
28
29
# File 'lib/meibo/organization_set.rb', line 27

def local
  @cache[:local] ||= new(select(&:local?))
end

#nationalObject



35
36
37
# File 'lib/meibo/organization_set.rb', line 35

def national
  @cache[:national] ||= new(select(&:national?))
end

#schoolObject



19
20
21
# File 'lib/meibo/organization_set.rb', line 19

def school
  @cache[:school] ||= new(select(&:school?))
end

#stateObject



31
32
33
# File 'lib/meibo/organization_set.rb', line 31

def state
  @cache[:state] ||= new(select(&:state?))
end