I'm using the hippo gem to parse X12 files into their segments and values. I am using the parser method and I expected it to return variables of the class: Hippo::TransactionSets::Hippa_837::Base but the value returned is of class Array. Within the library I can put the quantity I need into a global variable and access it that way but I don't think I should have to do that. I tried to create a variable of the class and set its value with the parser method return, so far no luck with that.
begin
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'pp'
require 'pry'
require 'hippo'
t = Hippo::Parser.parse_string(File.read('c:/test.edi'))
puts "DONE: "
puts t.class
puts $t.class
gets
puts $t.ST
end
The output:
DONE:
Hippo::TransactionSets::HIPAA_837::Base
Array
ST*837*0021*005010X222A1~
$t is the global variable I set in the parser.rb lib file. t turns out to be an array class without the methods to access segments.