Class: Kreuzberg::Result::ElementStruct
- Inherits:
-
Struct
- Object
- Struct
- Kreuzberg::Result::ElementStruct
- Defined in:
- lib/kreuzberg/result.rb
Instance Attribute Summary collapse
-
#element_id ⇒ String
readonly
Unique element identifier.
-
#element_type ⇒ String
readonly
Semantic type of the element.
-
#metadata ⇒ ElementMetadataStruct
readonly
Metadata about the element.
-
#text ⇒ String
readonly
Text content of the element.
Instance Method Summary collapse
Instance Attribute Details
#element_id ⇒ String (readonly)
Returns Unique element identifier.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/kreuzberg/result.rb', line 231 ElementStruct = Struct.new(:element_id, :element_type, :text, :metadata) do def to_h { element_id: element_id, element_type: element_type, text: text, metadata: &.to_h } end end |
#element_type ⇒ String (readonly)
Returns Semantic type of the element.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/kreuzberg/result.rb', line 231 ElementStruct = Struct.new(:element_id, :element_type, :text, :metadata) do def to_h { element_id: element_id, element_type: element_type, text: text, metadata: &.to_h } end end |
#metadata ⇒ ElementMetadataStruct (readonly)
Returns Metadata about the element.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/kreuzberg/result.rb', line 231 ElementStruct = Struct.new(:element_id, :element_type, :text, :metadata) do def to_h { element_id: element_id, element_type: element_type, text: text, metadata: &.to_h } end end |
#text ⇒ String (readonly)
Returns Text content of the element.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/kreuzberg/result.rb', line 231 ElementStruct = Struct.new(:element_id, :element_type, :text, :metadata) do def to_h { element_id: element_id, element_type: element_type, text: text, metadata: &.to_h } end end |
Instance Method Details
#to_h ⇒ Object
232 233 234 235 236 237 238 239 |
# File 'lib/kreuzberg/result.rb', line 232 def to_h { element_id: element_id, element_type: element_type, text: text, metadata: &.to_h } end |