Class: Ykutils::StructuredTextForAccountOneLayerDomain

Inherits:
StructuredTextForAccountOneLayer show all
Defined in:
lib/ykutils/stext.rb

Instance Attribute Summary

Attributes inherited from StructuredTextForAccountOneLayer

#item_ary

Instance Method Summary collapse

Constructor Details

#initializeStructuredTextForAccountOneLayerDomain

Returns a new instance of StructuredTextForAccountOneLayerDomain.



247
248
249
250
# File 'lib/ykutils/stext.rb', line 247

def initialize
  super
  @line_ary = []
end

Instance Method Details

#analyze(status, line, key, _value, main_line_ary, main_line_hash) ⇒ Object



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/ykutils/stext.rb', line 252

def analyze(status, line, key, _value, main_line_ary, main_line_hash)
  case status
  when AccountLines::DOMAIN_ACCOUNT_START
    key.sub!(/^==/, "")
    @title = line["CONTENT"]
    @line_ary << line["CONTENT"]
  when AccountLines::DOMAIN_ACCOUNT
    @line_ary << line["CONTENT"]
  when AccountLines::DOMAIN_ACCOUNT_END
    main_line_ary << @title
    main_line_hash[@title] = { "TITLE" => @title, "CONTENT" => @line_ary }
    @title = ""
    @line_ary = []
  end
end