Class: AddressValidation::Candidate

Inherits:
Data
  • Object
show all
Defined in:
app/services/address_validation/candidate.rb

Overview

A single normalized address returned by a provider. Field semantics match
the Address model so a candidate can be applied directly via
Address#correct_to!.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(street1: nil, street2: nil, street3: nil, city: nil, state_code: nil, zip: nil, residential: nil) ⇒ void

Parameters:

  • street1 (String, nil) (defaults to: nil)

    primary street line

  • street2 (String, nil) (defaults to: nil)

    secondary street line

  • street3 (String, nil) (defaults to: nil)

    tertiary street line

  • city (String, nil) (defaults to: nil)
  • state_code (String, nil) (defaults to: nil)
  • zip (String, nil) (defaults to: nil)

    postal code

  • residential (Boolean, nil) (defaults to: nil)

    whether the address is residential



18
19
20
# File 'app/services/address_validation/candidate.rb', line 18

def initialize(street1: nil, street2: nil, street3: nil, city: nil, state_code: nil, zip: nil, residential: nil)
  super
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def city
  @city
end

#residentialObject (readonly)

Returns the value of attribute residential

Returns:

  • (Object)

    the current value of residential



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def residential
  @residential
end

#state_codeObject (readonly)

Returns the value of attribute state_code

Returns:

  • (Object)

    the current value of state_code



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def state_code
  @state_code
end

#street1Object (readonly)

Returns the value of attribute street1

Returns:

  • (Object)

    the current value of street1



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def street1
  @street1
end

#street2Object (readonly)

Returns the value of attribute street2

Returns:

  • (Object)

    the current value of street2



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def street2
  @street2
end

#street3Object (readonly)

Returns the value of attribute street3

Returns:

  • (Object)

    the current value of street3



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def street3
  @street3
end

#zipObject (readonly)

Returns the value of attribute zip

Returns:

  • (Object)

    the current value of zip



9
10
11
# File 'app/services/address_validation/candidate.rb', line 9

def zip
  @zip
end