Sha256: d5459f6e0c22ca1ccb7e57a112dff3b0e1bcb36f7b73aa6cfa80fc89a4af5678

Contents?: true

Size: 941 Bytes

Versions: 7

Compression:

Stored size: 941 Bytes

Contents

require 'ncs_navigator/mdes'

module NcsNavigator::Mdes
  ##
  # One dispostion code in the MDES.
  class DispositionCode

    attr_accessor :event
    attr_accessor :final_category
    attr_accessor :sub_category
    attr_accessor :disposition
    attr_accessor :interim_code
    attr_accessor :final_code

    ##
    # Given attributes (presumably loaded from a YAML file) create
    # a new instance of a DispositionCode
    # 
    # @return [DispositionCode] the created instance.
    def initialize(attrs)
      [:event, :final_category, :sub_category, :disposition, :interim_code, :final_code].each do |a|
        self.send("#{a}=", attrs[a.to_s])
      end
    end

    ##
    # Provides a briefer inspection for cleaner IRB use.
    #
    # @return [String]
    def inspect
      "\#<#{self.class} event=#{event.inspect} disposition=#{disposition.inspect} status_code=#{interim_code.inspect}/#{final_code.inspect}>"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ncs_mdes-0.7.0 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.6.1 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.6.0 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.5.0 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.4.2 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.4.1 lib/ncs_navigator/mdes/disposition_code.rb
ncs_mdes-0.4.0 lib/ncs_navigator/mdes/disposition_code.rb