class AmazonTRP::FieldKey

Attributes

block[R]
confidence[R]
content[R]
geometry[R]
id[R]
text[R]

Public Class Methods

new(block, children, blockMap) click to toggle source
# File lib/amazon-textract-parser-ruby.rb, line 156
def initialize(block, children, blockMap)
  @block = block
  @confidence = block[:confidence]
  @geometry = Geometry.new(block[:geometry])
  @id = block[:id]
  @text = ""
  @content = []
  
  t = []
  children.each do |eid|
    wb = blockMap[eid]
    if wb[:block_type] == "WORD"
      w = Word.new(wb, blockMap)
      @content.append(w)
      t.append(w.text)
    end
  end
  @text = t.join(' ') if t
end

Public Instance Methods

to_s() click to toggle source
# File lib/amazon-textract-parser-ruby.rb, line 176
def to_s
  @text
end