Class: GS1::SyntaxDictionary::Parser
- Inherits:
-
Object
- Object
- GS1::SyntaxDictionary::Parser
- Defined in:
- lib/gs1/syntax_dictionary/parser.rb
Overview
Parser for the GS1 syntax dictionary.
The latest version of the syntax dictionary is available at: ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-dictionary.
The syntax dictionary has been copied to gs1-syntax-dictionary.txt. The format of the syntax dictionary is available at the top of the dictionary.
Defined Under Namespace
Modules: StringHelpers Classes: ColumnPatterns, Entry
Instance Method Summary collapse
-
#initialize(data) ⇒ Parser
constructor
A new instance of Parser.
-
#parse ⇒ Array<Entry>
Parses the syntax dictionary data and returns a list of dictionary entries.
Constructor Details
#initialize(data) ⇒ Parser
Returns a new instance of Parser.
49 50 51 |
# File 'lib/gs1/syntax_dictionary/parser.rb', line 49 def initialize(data) @data = data end |
Instance Method Details
#parse ⇒ Array<Entry>
Parses the syntax dictionary data and returns a list of dictionary entries.
57 |
# File 'lib/gs1/syntax_dictionary/parser.rb', line 57 def parse = entry_lines.flat_map { parse_line(_1) } |