Class: Gugl::Search::DataGetter

Inherits:
Object
  • Object
show all
Defined in:
lib/search/data_getter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#limitObject

Returns the value of attribute limit.



7
8
9
# File 'lib/search/data_getter.rb', line 7

def limit
  @limit
end

#queryObject

Returns the value of attribute query.



7
8
9
# File 'lib/search/data_getter.rb', line 7

def query
  @query
end

Instance Method Details

#getObject



9
10
11
12
13
# File 'lib/search/data_getter.rb', line 9

def get
  searcher.search(query, limit) do |items|
    items.map(&method(:build_item))
  end
end

#searcherObject



15
16
17
# File 'lib/search/data_getter.rb', line 15

def searcher
  @searcher ||= RemoteSearcher.new
end