lib/ncs_navigator/mdes/specification.rb in ncs_mdes-0.3.1 vs lib/ncs_navigator/mdes/specification.rb in ncs_mdes-0.4.0

- old
+ new

@@ -128,9 +128,29 @@ end end private :read_types ## + # @return [Array<DispositionCode>] all the named disposition codes in the MDES. + def disposition_codes + @disposition_codes ||= + begin + if File.exist?(source_documents.disposition_codes) + YAML.load(File.read source_documents.disposition_codes).collect do |dc| + DispositionCode.new(dc) + end + else + empty_disposition_codes + end + end + end + + def empty_disposition_codes + [] + end + private :empty_disposition_codes + + ## # A briefer inspection for nicer IRB sessions. # # @return [String] def inspect "#<#{self.class} version=#{version.inspect}>"