Class: SmartyStreets::USEnrichment::Secondary::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, etag = nil) ⇒ Response

Returns a new instance of Response.



11
12
13
14
15
16
17
18
19
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 11

def initialize(obj, etag=nil)
  @smarty_key = obj['smarty_key']
  @root_address = Secondary::RootAddressEntry.new(obj['root_address'])
  if !obj['aliases'].nil?
    @aliases = createAliasesArray(obj['aliases'])
  end
  @secondaries = createSecondariesArray(obj['secondaries'])
  @etag=etag
end

Instance Attribute Details

#aliasesObject (readonly)

Returns the value of attribute aliases.



9
10
11
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 9

def aliases
  @aliases
end

#etagObject (readonly)

Returns the value of attribute etag.



9
10
11
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 9

def etag
  @etag
end

#root_addressObject (readonly)

Returns the value of attribute root_address.



9
10
11
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 9

def root_address
  @root_address
end

#secondariesObject (readonly)

Returns the value of attribute secondaries.



9
10
11
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 9

def secondaries
  @secondaries
end

#smarty_keyObject (readonly)

Returns the value of attribute smarty_key.



9
10
11
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 9

def smarty_key
  @smarty_key
end

Instance Method Details

#createAliasesArray(obj) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 21

def createAliasesArray(obj)
  aliasesArray = []
  for item in obj do
    aliasesArray << Secondary::AliasesEntry.new(item)
  end
  return aliasesArray
end

#createSecondariesArray(obj) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb', line 29

def createSecondariesArray(obj)
  secondariesArray = []
  for item in obj do
    secondariesArray << Secondary::SecondariesEntry.new(item)
  end
  return secondariesArray
end