Class: Stupidedi::Config::TransactionSetConfig
- Inherits:
-
Object
- Object
- Stupidedi::Config::TransactionSetConfig
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/config/transaction_set_config.rb
Overview
The implementation version specified in GS08 (or ST03) indicates which implementation guide governs the transaction.
Note we can't look only at ST01 to link "837" to our definition of 837P from the HIPAA guide without also considering "005010X222", because thereare several different "837"s (including "005010X223", etc)
Instance Attribute Summary collapse
Instance Method Summary collapse
- #at(gs08, gs01, st01) ⇒ TransactionSetDef
- #customize(&block) ⇒ Object
- #defined_at?(gs08, gs01, st01) ⇒ Boolean
- #empty? ⇒ Boolean
-
#initialize ⇒ TransactionSetConfig
constructor
A new instance of TransactionSetConfig.
-
#pretty_print(q) ⇒ void
:nocov:.
- #register(gs08, gs01, st01, definition = nil, &constructor) ⇒ void
Methods included from Inspect
Constructor Details
#initialize ⇒ TransactionSetConfig
Returns a new instance of TransactionSetConfig.
20 21 22 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 20 def initialize @table = Hash.new end |
Instance Attribute Details
#table ⇒ Hash<[GS08/ST03, GS01, ST01], TransactionSetDef> (readonly)
18 19 20 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 18 def table @table end |
Instance Method Details
#at(gs08, gs01, st01) ⇒ TransactionSetDef
42 43 44 45 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 42 def at(gs08, gs01, st01) x = @table[Array[gs08, gs01, st01]] x.is_a?(Proc) ? x.call : x end |
#customize(&block) ⇒ Object
24 25 26 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 24 def customize(&block) tap(&block) end |
#defined_at?(gs08, gs01, st01) ⇒ Boolean
47 48 49 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 47 def defined_at?(gs08, gs01, st01) @table.defined_at?([gs08, gs01, st01]) end |
#empty? ⇒ Boolean
51 52 53 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 51 def empty? @table.empty? end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
:nocov:
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 57 def pretty_print(q) q.text "TransactionSetConfig" q.group(2, "(", ")") do q.breakable "" @table.keys.each do |e| unless q.current_group.first? q.text "," q.breakable end q.pp e end end end |
#register(gs08, gs01, st01, definition = nil, &constructor) ⇒ void
This method returns an undefined value.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 29 def register(gs08, gs01, st01, definition = nil, &constructor) if block_given? @table[Array[gs08, gs01, st01]] = constructor elsif definition.nil? raise ArgumentError, "TransactionSetConfig#register(#{gs08.inspect}, #{gs01.inspect}, " \ "#{st01.inspect}) was called with no definition and no block" else @table[Array[gs08, gs01, st01]] = definition end end |