Class: YahooJapanAPI::UpdatedSearch

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/yahoo-japan-api/updated_search.rb

Instance Attribute Summary

Attributes included from Base::ClassMethods

#appid

Class Method Summary collapse

Methods included from Base

included

Class Method Details

.call(query) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/yahoo-japan-api/updated_search.rb', line 12

def self.call(query)
  response = RestClient.get(@url, params: { appid: @appid, query: query})
  xml = Nokogiri response
  (xml / 'Result').map do |r|
    { title: (r/'Title').text,
      summary: (r/'Summary').text,
      url: (r/'Url').text }
  end
end