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

Constructor Details

#initializeStructuredTextForAccountOneLayerHost

Returns a new instance of StructuredTextForAccountOneLayerHost.



272
273
274
# File 'lib/ykutils/stext.rb', line 272

def initialize
  super
end

Instance Method Details

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



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/ykutils/stext.rb', line 276

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