Class: Hatena::Keyword::Link

Inherits:
Service
  • Object
show all
Defined in:
lib/hatena/keyword.rb

Instance Method Summary collapse

Methods inherited from Service

#execute, #initialize

Constructor Details

This class inherits a constructor from Hatena::Keyword::Service

Instance Method Details

#replace(&block) ⇒ Object



64
65
66
# File 'lib/hatena/keyword.rb', line 64

def replace(&block)
  result.gsub(%r{<a class="#{option(:a_class)}".*?>(.*?)</a>}i) {block.call($1)}
end