Class: Hatena::Keyword::Service
- Inherits:
-
Object
- Object
- Hatena::Keyword::Service
- Defined in:
- lib/hatena/keyword.rb
Overview
Service
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(string, options = {}) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(string, options = {}) ⇒ Service
Returns a new instance of Service.
31 32 33 34 35 |
# File 'lib/hatena/keyword.rb', line 31 def initialize(string, = {}) @string = NKF.nkf('-w', string.to_s) @options = @result = nil end |
Instance Method Details
#execute ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/hatena/keyword.rb', line 37 def execute server = XMLRPC::Client.new2('http://d.hatena.ne.jp/xmlrpc') method = 'hatena.setKeywordLink' hash = hash.delete(:body) logger.debug "#{self.class.name}(%s, %s)" % [method, hash.inspect] @result = server.call(method, ) end |