dm-chunked_query 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.1.1 / 2011-03-03
2
+
3
+ * Have {DataMapper::ChunkedQuery::Chunks#at} convert all arguments to Integers.
4
+ * Updated YARD documentation.
5
+
1
6
  ### 0.1.0 / 2011-03-02
2
7
 
3
8
  * Initial release:
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: dm-chunked_query
2
- version: 0.1.0
2
+ version: 0.1.1
3
3
  summary: Allows performing chunked queries with DataMapper.
4
4
  description:
5
5
  Allows performing chunked queries on DataMapper Models or Collections.
@@ -27,11 +27,12 @@ module DataMapper
27
27
  #
28
28
  # Provides random access to chunks.
29
29
  #
30
- # @param [Integer, Range<Integer>] key
30
+ # @param [Range<Integer>, Integer] key
31
31
  # The index or range of indices to access.
32
32
  #
33
- # @return [DataMapper::Collection, Array<DataMapper::Resource>]
33
+ # @return [DataMapper::Collection, nil]
34
34
  # A collection of resources at the given index or indices.
35
+ # If the index is out of bounds, `nil` will be returned.
35
36
  #
36
37
  def [](key)
37
38
  case key
@@ -41,11 +42,23 @@ module DataMapper
41
42
 
42
43
  chunk_at(index,span)
43
44
  when Integer
44
- chunk_at(key)
45
+ chunk_at(index)
45
46
  end
46
47
  end
47
48
 
48
- alias at []
49
+ #
50
+ # Accesses a chunk at a specific index.
51
+ #
52
+ # @param [#to_i] index
53
+ # The index to access.
54
+ #
55
+ # @return [DataMapper::Collection, nil]
56
+ # The chunk of resources at the given index. If the index is out of
57
+ # bounds, `nil` will be returned.
58
+ #
59
+ def at(index)
60
+ chunk_at(key.to_i)
61
+ end
49
62
 
50
63
  #
51
64
  # Enumerates over each chunk in the collection of Chunks.
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dm-chunked_query
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Postmodern
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-02 00:00:00 -08:00
13
+ date: 2011-03-03 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency