Class: Hatena::Keyword

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

Defined Under Namespace

Classes: Link, Retrieve, Service

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cnameObject

Returns the value of attribute cname

Returns:

  • (Object)

    the current value of cname



3
4
5
# File 'lib/hatena/keyword.rb', line 3

def cname
  @cname
end

#refcountObject

Returns the value of attribute refcount

Returns:

  • (Object)

    the current value of refcount



3
4
5
# File 'lib/hatena/keyword.rb', line 3

def refcount
  @refcount
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



3
4
5
# File 'lib/hatena/keyword.rb', line 3

def score
  @score
end

#wordObject

Returns the value of attribute word

Returns:

  • (Object)

    the current value of word



3
4
5
# File 'lib/hatena/keyword.rb', line 3

def word
  @word
end

Class Method Details

.[](body) ⇒ Object



19
20
21
# File 'lib/hatena/keyword.rb', line 19

def [](body)
  search(body).map(&:to_s).uniq
end


15
16
17
# File 'lib/hatena/keyword.rb', line 15

def link(body)
  Hatena::Keyword::Link.new(body).execute
end

.search(body) ⇒ Object



11
12
13
# File 'lib/hatena/keyword.rb', line 11

def search(body)
  Hatena::Keyword::Retrieve.new(body).execute
end

Instance Method Details

#to_sObject



6
7
8
# File 'lib/hatena/keyword.rb', line 6

def to_s
  word
end