Class: Mindee::Parsing::V2::Field::FieldLocation
- Inherits:
-
Object
- Object
- Mindee::Parsing::V2::Field::FieldLocation
- Defined in:
- lib/mindee/parsing/v2/field/field_location.rb
Overview
Location of a field.
Instance Attribute Summary collapse
-
#page ⇒ Integer?
readonly
Page on which the field is located.
-
#polygon ⇒ Mindee::Geometry::Polygon?
readonly
Polygon corresponding to the field location.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ FieldLocation
constructor
A new instance of FieldLocation.
-
#to_s ⇒ String
String representation of the polygon (empty string when none).
Constructor Details
#initialize(server_response) ⇒ FieldLocation
Returns a new instance of FieldLocation.
18 19 20 21 |
# File 'lib/mindee/parsing/v2/field/field_location.rb', line 18 def initialize(server_response) @polygon = Mindee::Geometry::Polygon.new(server_response['polygon']) @page = server_response['page'] end |
Instance Attribute Details
#page ⇒ Integer? (readonly)
Returns Page on which the field is located.
15 16 17 |
# File 'lib/mindee/parsing/v2/field/field_location.rb', line 15 def page @page end |
#polygon ⇒ Mindee::Geometry::Polygon? (readonly)
Returns Polygon corresponding to the field location.
12 13 14 |
# File 'lib/mindee/parsing/v2/field/field_location.rb', line 12 def polygon @polygon end |
Instance Method Details
#to_s ⇒ String
String representation of the polygon (empty string when none).
26 27 28 |
# File 'lib/mindee/parsing/v2/field/field_location.rb', line 26 def to_s @polygon ? @polygon.to_s : '' end |