class Mccandlish::Result

Attributes

articles[R]
hits[R]
offset[R]
status[R]

Public Class Methods

create_from_parsed_response(results) click to toggle source
# File lib/mccandlish/result.rb, line 13
def self.create_from_parsed_response(results)
  self.new(:hits => results['response']['meta']['hits'],
    :offset => results['response']['meta']['offset'],
    :copyright => results['copyright'],
    :status => results['status'],
    :articles => Article.create_from_results(results['response']['docs'])
  )
end
new(params={}) click to toggle source
# File lib/mccandlish/result.rb, line 7
def initialize(params={})
  params.each_pair do |k,v|
   instance_variable_set("@#{k}", v)
  end
end