Class: Mindee::V1::Parsing::Standard::AddressField

Inherits:
StringField show all
Defined in:
lib/mindee/v1/parsing/standard/address_field.rb

Overview

Represents physical-address information.

Instance Attribute Summary collapse

Attributes inherited from StringField

#raw_value, #value

Attributes inherited from BaseField

#reconstructed, #value

Attributes inherited from AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

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_complementString? (readonly)

Address complement

Returns:

  • (String, nil)


22
23
24
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 22

def address_complement
  @address_complement
end

#cityString? (readonly)

City name.

Returns:

  • (String, nil)


25
26
27
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 25

def city
  @city
end

#countryString? (readonly)

Country.

Returns:

  • (String, nil)


34
35
36
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 34

def country
  @country
end

#po_boxString? (readonly)

PO Box number

Returns:

  • (String, nil)


19
20
21
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 19

def po_box
  @po_box
end

#postal_codeString? (readonly)

Postal or ZIP code.

Returns:

  • (String, nil)


28
29
30
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 28

def postal_code
  @postal_code
end

#stateString? (readonly)

State, province or region.

Returns:

  • (String, nil)


31
32
33
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 31

def state
  @state
end

#street_nameString? (readonly)

Street name

Returns:

  • (String, nil)


16
17
18
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 16

def street_name
  @street_name
end

#street_numberString? (readonly)

Street number

Returns:

  • (String, nil)


13
14
15
# File 'lib/mindee/v1/parsing/standard/address_field.rb', line 13

def street_number
  @street_number
end