revolver 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.markdown +9 -0
  2. data/lib/revolver.rb +4 -0
  3. metadata +2 -2
data/README.markdown CHANGED
@@ -21,6 +21,11 @@ Alternatively, you can create a `Revolver` from an existing array:
21
21
  Revolver.from_array([*1..3], 3)
22
22
  #=> #<Revolver: [1, 2, 3]>
23
23
 
24
+ Or from a list of elements:
25
+
26
+ Revolver[*1..3]
27
+ #=> #<Revolver: [1, 2, 3]>
28
+
24
29
  You can also create a unique `Revolver` that way:
25
30
 
26
31
  Revolver.from_array([1, 1, 3], true)
@@ -71,6 +76,10 @@ Finally you can get a plain array out of a `Revolver`:
71
76
  r.to_a
72
77
  #=> [1, 2, 3, 4, 5]
73
78
 
79
+ Thanks
80
+ ---
81
+ * [Wojtek Mach](https://github.com/wojtekmach) for [adding](https://github.com/citizen428/revolver/pull/1) `Revolver.[]`.
82
+
74
83
  License
75
84
  ---
76
85
 
data/lib/revolver.rb CHANGED
@@ -4,6 +4,10 @@ class Revolver
4
4
  array.inject(rev) { |r, e| r << e }
5
5
  end
6
6
 
7
+ def self.[](*array)
8
+ from_array(array)
9
+ end
10
+
7
11
  def initialize(size, unique = false)
8
12
  @array = []
9
13
  @size = size
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revolver
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-24 00:00:00.000000000 Z
12
+ date: 2012-08-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: citizen428@gmail.com