Class: SmartyStreets::USEnrichment::Secondary::Response
- Inherits:
-
Object
- Object
- SmartyStreets::USEnrichment::Secondary::Response
- Defined in:
- lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#etag ⇒ Object
readonly
Returns the value of attribute etag.
-
#root_address ⇒ Object
readonly
Returns the value of attribute root_address.
-
#secondaries ⇒ Object
readonly
Returns the value of attribute secondaries.
-
#smarty_key ⇒ Object
readonly
Returns the value of attribute smarty_key.
Instance Method Summary collapse
- #createAliasesArray(obj) ⇒ Object
- #createSecondariesArray(obj) ⇒ Object
-
#initialize(obj, etag = nil) ⇒ Response
constructor
A new instance of Response.
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
#aliases ⇒ Object (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 |
#etag ⇒ Object (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_address ⇒ Object (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 |
#secondaries ⇒ Object (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_key ⇒ Object (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 |