Class: NcsNavigator::Mdes::DispositionCode

Inherits:
Object
  • Object
show all
Defined in:
lib/ncs_navigator/mdes/disposition_code.rb

Overview

One dispostion code in the MDES.

Constant Summary collapse

ATTRIBUTES =
%w(
  category_code disposition event final_category final_code interim_code sub_category
)

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ DispositionCode

Given attributes (presumably loaded from a YAML file) create a new instance of a DispositionCode



20
21
22
# File 'lib/ncs_navigator/mdes/disposition_code.rb', line 20

def initialize(attrs)
  ATTRIBUTES.each { |a| send("#{a}=", attrs[a]) }
end

Instance Method Details

#inspectString

Provides a briefer inspection for cleaner IRB use.

Returns:

  • (String)


37
38
39
# File 'lib/ncs_navigator/mdes/disposition_code.rb', line 37

def inspect
  "\#<#{self.class} event=#{event.inspect} disposition=#{disposition.inspect} status_code=#{interim_code.inspect}/#{final_code.inspect}>"
end

#success?Boolean

If the code's final category signifies successful completion, returns true; otherwise, returns false.

Returns:

  • (Boolean)


29
30
31
# File 'lib/ncs_navigator/mdes/disposition_code.rb', line 29

def success?
  final_category.to_s.start_with?('Complete')
end