Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentDocumentLayoutDocumentLayoutBlockLayoutTextBlock

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/documentai_v1/classes.rb,
lib/google/apis/documentai_v1/representations.rb,
lib/google/apis/documentai_v1/representations.rb

Overview

Represents a text type block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1DocumentDocumentLayoutDocumentLayoutBlockLayoutTextBlock

Returns a new instance of GoogleCloudDocumentaiV1DocumentDocumentLayoutDocumentLayoutBlockLayoutTextBlock.



4050
4051
4052
# File 'lib/google/apis/documentai_v1/classes.rb', line 4050

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#annotationsGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentAnnotations

Represents the annotation of a block or a chunk. Corresponds to the JSON property annotations



4030
4031
4032
# File 'lib/google/apis/documentai_v1/classes.rb', line 4030

def annotations
  @annotations
end

#blocksArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentDocumentLayoutDocumentLayoutBlock>

A text block could further have child blocks. Repeated blocks support further hierarchies and nested blocks. Corresponds to the JSON property blocks



4036
4037
4038
# File 'lib/google/apis/documentai_v1/classes.rb', line 4036

def blocks
  @blocks
end

#textString

Text content stored in the block. Corresponds to the JSON property text

Returns:

  • (String)


4041
4042
4043
# File 'lib/google/apis/documentai_v1/classes.rb', line 4041

def text
  @text
end

#typeString

Type of the text in the block. Available options are: paragraph, subtitle, heading-1, heading-2, heading-3, heading-4, heading-5, header, footer. Corresponds to the JSON property type

Returns:

  • (String)


4048
4049
4050
# File 'lib/google/apis/documentai_v1/classes.rb', line 4048

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4055
4056
4057
4058
4059
4060
# File 'lib/google/apis/documentai_v1/classes.rb', line 4055

def update!(**args)
  @annotations = args[:annotations] if args.key?(:annotations)
  @blocks = args[:blocks] if args.key?(:blocks)
  @text = args[:text] if args.key?(:text)
  @type = args[:type] if args.key?(:type)
end