Class: Stupidedi::Config::FunctionalGroupConfig
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/config/functional_group_config.rb
Overview
The functional group segments (GS/GE) and the segments contained by that functional group are versioned separately from the interchange control segments (ISA/ISE). The functional group version is informally referred to as the EDI version (5010, 4010, etc). Each version indicates the segment dictionary being used and the grammar of the functional group. Only the GS and GE segments are described in the HIPAA guides, but the functional group header and footer may consist of other segments.
Because the interchange and functional group are versioned independently, it may be possible, for instance, to send a 4010 transaction set within a 5010 envelope, depending on forward- and backward-comatibility.
Instance Method Summary collapse
- #at(version) ⇒ FunctionalGroupDef
-
#initialize ⇒ FunctionalGroupConfig
constructor
A new instance of FunctionalGroupConfig.
- #pretty_print(q) ⇒ void
- #register(version, definition = nil, &constructor) ⇒ void
Methods included from Inspect
Constructor Details
#initialize ⇒ FunctionalGroupConfig
Returns a new instance of FunctionalGroupConfig.
24 25 26 |
# File 'lib/stupidedi/config/functional_group_config.rb', line 24 def initialize @table = Hash.new end |
Instance Method Details
#at(version) ⇒ FunctionalGroupDef
40 41 42 43 |
# File 'lib/stupidedi/config/functional_group_config.rb', line 40 def at(version) x = @table[version] x.is_a?(Proc) ? x.call : x end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/stupidedi/config/functional_group_config.rb', line 46 def pretty_print(q) q.text "FunctionalGroupConfig" 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(version, definition = nil, &constructor) ⇒ void
This method returns an undefined value.
31 32 33 34 35 36 37 |
# File 'lib/stupidedi/config/functional_group_config.rb', line 31 def register(version, definition = nil, &constructor) if block_given? @table[version] = constructor else @table[version] = definition end end |