Class: Stupidedi::Config
- Inherits:
-
Object
- Object
- Stupidedi::Config
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/config.rb,
lib/stupidedi/config/code_list_config.rb,
lib/stupidedi/config/interchange_config.rb,
lib/stupidedi/config/transaction_set_config.rb,
lib/stupidedi/config/functional_group_config.rb
Defined Under Namespace
Classes: CodeListConfig, FunctionalGroupConfig, InterchangeConfig, TransactionSetConfig
Instance Attribute Summary collapse
- #code_list ⇒ CodeListConfig readonly
- #functional_group ⇒ FunctionalGroupConfig readonly
- #interchange ⇒ InterchangeConfig readonly
- #transaction_set ⇒ TransactionSetConfig readonly
Constructors collapse
-
.contrib(base = default) ⇒ Config
See Config.default.
-
.default ⇒ Config
Returns an empty Config.
-
.hipaa(base = default) ⇒ Config
See Config.default.
Instance Method Summary collapse
- #customize(&block) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #pretty_print(q) ⇒ void
Methods included from Inspect
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
25 26 27 28 29 30 |
# File 'lib/stupidedi/config.rb', line 25 def initialize @interchange = InterchangeConfig.new @functional_group = FunctionalGroupConfig.new @transaction_set = TransactionSetConfig.new @code_list = CodeListConfig.new end |
Instance Attribute Details
#code_list ⇒ CodeListConfig (readonly)
23 24 25 |
# File 'lib/stupidedi/config.rb', line 23 def code_list @code_list end |
#functional_group ⇒ FunctionalGroupConfig (readonly)
17 18 19 |
# File 'lib/stupidedi/config.rb', line 17 def functional_group @functional_group end |
#interchange ⇒ InterchangeConfig (readonly)
14 15 16 |
# File 'lib/stupidedi/config.rb', line 14 def interchange @interchange end |
#transaction_set ⇒ TransactionSetConfig (readonly)
20 21 22 |
# File 'lib/stupidedi/config.rb', line 20 def transaction_set @transaction_set end |
Class Method Details
.contrib(base = default) ⇒ Config
See default. Preserved for source compatibility; returns the base
unmodified.
93 94 95 |
# File 'lib/stupidedi/config.rb', line 93 def contrib(base = default) base end |
.default ⇒ Config
Returns an empty Config.
tediparse does not ship with X12 grammars or transaction-set definitions
— those are X12 IP that the gem is not licensed to redistribute. This
method is preserved for source compatibility with upstream stupidedi
callers; an empty Config means parser-driven lookups produce a
FailureState whose reason is
Stupidedi::Exceptions::MissingGrammarError::DEFAULT_MESSAGE.
Register your own grammar with #customize before parsing. See the
README and spec/support/synthetic/demo.rb for an authoring example.
76 77 78 |
# File 'lib/stupidedi/config.rb', line 76 def default new end |
.hipaa(base = default) ⇒ Config
See default. Preserved for source compatibility; returns an empty
Config built atop base so existing call sites that compose
configurations (e.g. Config.hipaa(my_base)) keep working.
85 86 87 |
# File 'lib/stupidedi/config.rb', line 85 def hipaa(base = default) base end |
Instance Method Details
#customize(&block) ⇒ Object
32 33 34 |
# File 'lib/stupidedi/config.rb', line 32 def customize(&block) tap(&block) end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/stupidedi/config.rb', line 37 def pretty_print(q) q.text "Config" q.group 2, "(", ")" do q.breakable "" q.pp @interchange q.text "," q.breakable q.pp @functional_group q.text "," q.breakable q.pp @transaction_set q.text "," q.breakable q.pp @code_list end end |