Class: Mindee::Parsing::Standard::AddressField
- Inherits:
-
StringField
- Object
- AbstractField
- BaseField
- StringField
- Mindee::Parsing::Standard::AddressField
- Defined in:
- lib/mindee/parsing/standard/address_field.rb
Overview
Represents physical-address information.
Instance Attribute Summary collapse
-
#address_complement ⇒ String?
readonly
Address complement.
-
#city ⇒ String?
readonly
City name.
-
#country ⇒ String?
readonly
Country.
-
#po_box ⇒ String?
readonly
PO Box number.
-
#postal_code ⇒ String?
readonly
Postal or ZIP code.
-
#state ⇒ String?
readonly
State, province or region.
-
#street_name ⇒ String?
readonly
Street name.
-
#street_number ⇒ String?
readonly
Street number.
Attributes inherited from StringField
Attributes inherited from BaseField
Attributes inherited from AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id = nil, reconstructed: false) ⇒ AddressField
constructor
A new instance of AddressField.
Methods inherited from AbstractField
array_confidence, array_sum, float_to_string, #to_s
Constructor Details
#initialize(prediction, page_id = nil, reconstructed: false) ⇒ AddressField
Returns a new instance of AddressField.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 35 def initialize(prediction, page_id = nil, reconstructed: false) super @street_number = prediction['street_number'] @street_name = prediction['street_name'] @po_box = prediction['po_box'] @address_complement = prediction['address_complement'] @city = prediction['city'] @postal_code = prediction['postal_code'] @state = prediction['state'] @country = prediction['country'] end |
Instance Attribute Details
#address_complement ⇒ String? (readonly)
Address complement
21 22 23 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 21 def address_complement @address_complement end |
#city ⇒ String? (readonly)
City name.
24 25 26 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 24 def city @city end |
#country ⇒ String? (readonly)
Country.
33 34 35 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 33 def country @country end |
#po_box ⇒ String? (readonly)
PO Box number
18 19 20 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 18 def po_box @po_box end |
#postal_code ⇒ String? (readonly)
Postal or ZIP code.
27 28 29 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 27 def postal_code @postal_code end |
#state ⇒ String? (readonly)
State, province or region.
30 31 32 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 30 def state @state end |
#street_name ⇒ String? (readonly)
Street name
15 16 17 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 15 def street_name @street_name end |
#street_number ⇒ String? (readonly)
Street number
12 13 14 |
# File 'lib/mindee/parsing/standard/address_field.rb', line 12 def street_number @street_number end |