gummi 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ module Gummi
3
3
  module Repository
4
4
  class Result
5
5
 
6
- attr_reader :took, :total, :hits
6
+ attr_reader :took
7
7
 
8
8
  def initialize(search_result, converter)
9
9
  @search_result = search_result
@@ -23,10 +23,6 @@ module Gummi
23
23
  end
24
24
  end
25
25
 
26
- def total
27
- documents.total_entries
28
- end
29
-
30
26
  def records
31
27
  @records ||= begin
32
28
  # Passing through the Leaflet Collection, but converting the records.
@@ -35,6 +31,14 @@ module Gummi
35
31
  end
36
32
  end
37
33
 
34
+ # Leaflet::Collection has many methods we want to make use of.
35
+ # E.g. kaminari and will_paginate support.
36
+ # Also, we want to have Enumerable and #decorate at our fingertips.
37
+ #
38
+ def method_missing(method_name, *args)
39
+ records.send method_name, *args
40
+ end
41
+
38
42
  private
39
43
 
40
44
  attr_reader :search_result, :converter, :documents
data/lib/gummi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gummi
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -57,7 +57,7 @@ describe Gummi::RepositoryLayer::Repository do
57
57
  search.query_string = 'Woody'
58
58
  search.facets[:names] = { terms: { field: :name, all_terms: true, size: 100 } }
59
59
  end
60
- result.total.should == 1
60
+ result.total_entries.should == 1
61
61
  result.facets.names.woody.should == 1
62
62
  result.records.first.name.should == 'Woody'
63
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gummi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -269,18 +269,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
269
  - - ! '>='
270
270
  - !ruby/object:Gem::Version
271
271
  version: '0'
272
- segments:
273
- - 0
274
- hash: 1073963271275319698
275
272
  required_rubygems_version: !ruby/object:Gem::Requirement
276
273
  none: false
277
274
  requirements:
278
275
  - - ! '>='
279
276
  - !ruby/object:Gem::Version
280
277
  version: '0'
281
- segments:
282
- - 0
283
- hash: 1073963271275319698
284
278
  requirements: []
285
279
  rubyforge_project:
286
280
  rubygems_version: 1.8.23