Class: SmartyStreets::USExtract::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_extract/address.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Address

Returns a new instance of Address.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 9

def initialize(obj)
  @text = obj['text']
  @verified = obj['verified']
  @line = obj['line']
  @start = obj['start']
  @end = obj['end']
  candidates = obj.fetch('api_output', [])
  @candidates = []

  candidates.each {|candidate|
    @candidates.push(USStreet::Candidate.new(candidate))
  }
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def candidates
  @candidates
end

#endObject (readonly)

Returns the value of attribute end.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def end
  @end
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def line
  @line
end

#startObject (readonly)

Returns the value of attribute start.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def start
  @start
end

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def text
  @text
end

#verifiedObject (readonly)

Returns the value of attribute verified.



7
8
9
# File 'lib/smartystreets_ruby_sdk/us_extract/address.rb', line 7

def verified
  @verified
end