Class: Ykutils::StructuredTextForAccountOneLayerHost

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

Instance Attribute Summary

Attributes inherited from StructuredTextForAccountOneLayer

#item_ary

Instance Method Summary collapse

Methods inherited from StructuredTextForAccountOneLayer

#initialize

Constructor Details

This class inherits a constructor from Ykutils::StructuredTextForAccountOneLayer

Instance Method Details

#analyze(status, line, key, _value, main_ary, main_hash) ⇒ Object



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/ykutils/stext.rb', line 270

def analyze(status, line, key, _value, main_ary, main_hash)
  case status
  when AccountLines::HOST_ACCOUNT_START
    @hash[key] = line["CONTENT"]
    @title = line["CONTENT"]
  when AccountLines::HOST_ACCOUNT
    @ary << key
    @hash[key] = line["CONTENT"]
  when AccountLines::HOST_ACCOUNT_END
    main_ary << @title
    main_hash[@title] = { "TITLE" => @title, "CONTENT" => @hash, "META" => @ary }

    @item_ary |= @ary
    @ary = []
    @hash = {}
    @title = ""
  end
end