Class: BOSSMan::ResultSet

Inherits:
BaseValueObject show all
Defined in:
lib/bossman/result_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseValueObject

#method_missing, #set_parameter, #to_json, #to_yaml

Constructor Details

#initialize(response) ⇒ ResultSet

Returns a new instance of ResultSet.



4
5
6
7
# File 'lib/bossman/result_set.rb', line 4

def initialize(response)
  @response = response
  process_response
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BOSSMan::BaseValueObject

Class Method Details

._load(string) ⇒ Object



17
18
19
# File 'lib/bossman/result_set.rb', line 17

def self._load(string)
  ResultSet.new(ActiveSupport::JSON.decode(string))
end

Instance Method Details

#_dump(level) ⇒ Object



13
14
15
# File 'lib/bossman/result_set.rb', line 13

def _dump(level)
  @response.to_json
end

#to_xmlObject Also known as: to_s



9
10
11
# File 'lib/bossman/result_set.rb', line 9

def to_xml
  @response['ysearchresponse'].to_xml(:root => 'resultset')
end