Class: Mindee::V1::Parsing::Standard::AddressField
- Inherits:
-
StringField
- Object
- AbstractField
- BaseField
- StringField
- Mindee::V1::Parsing::Standard::AddressField
- Defined in:
- lib/mindee/v1/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.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 36 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
22 23 24 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 22 def address_complement @address_complement end |
#city ⇒ String? (readonly)
City name.
25 26 27 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 25 def city @city end |
#country ⇒ String? (readonly)
Country.
34 35 36 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 34 def country @country end |
#po_box ⇒ String? (readonly)
PO Box number
19 20 21 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 19 def po_box @po_box end |
#postal_code ⇒ String? (readonly)
Postal or ZIP code.
28 29 30 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 28 def postal_code @postal_code end |
#state ⇒ String? (readonly)
State, province or region.
31 32 33 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 31 def state @state end |
#street_name ⇒ String? (readonly)
Street name
16 17 18 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 16 def street_name @street_name end |
#street_number ⇒ String? (readonly)
Street number
13 14 15 |
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 13 def street_number @street_number end |