Class: WIS::DOM::AccountResults

Inherits:
Results
  • Object
show all
Defined in:
lib/dom/account_results.rb

Instance Attribute Summary collapse

Attributes inherited from Results

#hits

Class Method Summary collapse

Instance Method Summary collapse

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

#accountsObject (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