Class: WIS::DOM::AccountResults
- Defined in:
- lib/dom/account_results.rb
Instance Attribute Summary collapse
-
#accounts ⇒ Object
readonly
Returns the value of attribute accounts.
Attributes inherited from Results
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hits, accounts) ⇒ AccountResults
constructor
A new instance of AccountResults.
Constructor Details
#initialize(hits, accounts) ⇒ AccountResults
Returns a new instance of AccountResults.
4 5 6 7 |
# File 'lib/dom/account_results.rb', line 4 def initialize(hits, accounts) super(hits) @accounts = accounts end |
Instance Attribute Details
#accounts ⇒ Object (readonly)
Returns the value of attribute accounts.
2 3 4 |
# File 'lib/dom/account_results.rb', line 2 def accounts @accounts end |
Class Method Details
.adapt_json(data) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/dom/account_results.rb', line 9 def self.adapt_json(data) accounts = [] data["Accounts"].each do |a| accounts << WIS::DOM::Account.new(a["ID"], a["Name"], a["Description"]) end WIS::DOM::AccountResults.new(data["Hits"], accounts) end |