Class: SmartyStreets::USEnrichment::Business::Summary::Response
- Inherits:
-
Object
- Object
- SmartyStreets::USEnrichment::Business::Summary::Response
- Defined in:
- lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb
Instance Attribute Summary collapse
-
#businesses ⇒ Object
readonly
Returns the value of attribute businesses.
-
#data_set_name ⇒ Object
readonly
Returns the value of attribute data_set_name.
-
#smarty_key ⇒ Object
readonly
Returns the value of attribute smarty_key.
Instance Method Summary collapse
- #build_businesses(entries) ⇒ Object
-
#initialize(obj) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(obj) ⇒ Response
Returns a new instance of Response.
10 11 12 13 14 |
# File 'lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb', line 10 def initialize(obj) @smarty_key = obj['smarty_key'] @data_set_name = obj['data_set_name'] @businesses = build_businesses(obj['businesses']) end |
Instance Attribute Details
#businesses ⇒ Object (readonly)
Returns the value of attribute businesses.
8 9 10 |
# File 'lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb', line 8 def businesses @businesses end |
#data_set_name ⇒ Object (readonly)
Returns the value of attribute data_set_name.
8 9 10 |
# File 'lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb', line 8 def data_set_name @data_set_name end |
#smarty_key ⇒ Object (readonly)
Returns the value of attribute smarty_key.
8 9 10 |
# File 'lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb', line 8 def smarty_key @smarty_key end |
Instance Method Details
#build_businesses(entries) ⇒ Object
16 17 18 19 |
# File 'lib/smartystreets_ruby_sdk/us_enrichment/business/summary/response.rb', line 16 def build_businesses(entries) return [] if entries.nil? entries.map { |entry| Business::Summary::BusinessEntry.new(entry) } end |