lazy_stream 0.5.0 → 0.5.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lazy_stream.rb +4 -2
  3. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 166defa34d053f972bbed9af3675bc3f4b6c3da0
4
- data.tar.gz: 9f003140bb1e8bea9d54c32a15d36644a9d15dcc
3
+ metadata.gz: fa9d0377f7f4989c9dc30bc5c815a26a3aceec0a
4
+ data.tar.gz: a9442c1c658d99b5b79a90a8dad437481898cb45
5
5
  SHA512:
6
- metadata.gz: 4302666af3e03ae2c8f7faa57431addd7b8c7598fa66c7587f86c64026b77168992f3af6bd8718faed5cd7bf1ac172aaa3d51a5113b488979b1b9059043417ed
7
- data.tar.gz: d6e7f3d96e1715f5743d8a85a8349d2414b5957a66810c803a2dbdbf9d0b0d924380cc07ee87a8d23048c5583ee8827da72b7565f7924c7d58f5f1f8047c1a99
6
+ metadata.gz: c16adf4696ca3bba83c9b6c42923eeb387e3ea0b63426d0a3fc88486fdda41be57d6029edff0b32d355aea81af295b21733f7514ba6fd92b3989ff2f8cec84e3
7
+ data.tar.gz: cafc007afb204107a4954b991b44e861e5172fe975b6c0bc95c8a1e4c93944d42144f707c679c1cdbbdae9a6993c3b7ab10b8afe12e138650ee9398f73ae8791
data/lib/lazy_stream.rb CHANGED
@@ -16,16 +16,18 @@ class LazyStream
16
16
  first.nil?
17
17
  end
18
18
 
19
- def at(n)
19
+ def [](n)
20
20
  if empty?
21
21
  nil
22
22
  elsif n == 0
23
23
  first
24
24
  else
25
- rest.at(n - 1)
25
+ rest[n - 1]
26
26
  end
27
27
  end
28
28
 
29
+ alias_method :at, :[]
30
+
29
31
  def drop(n)
30
32
  empty? || n < 1 ? self : rest.drop(n - 1)
31
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mingmin Xie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-02 00:00:00.000000000 Z
11
+ date: 2013-05-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby infinite lazy stream
14
14
  email: melvinxie@gmail.com
@@ -18,7 +18,8 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/lazy_stream.rb
20
20
  homepage: https://github.com/melvinxie/lazy_stream
21
- licenses: []
21
+ licenses:
22
+ - MIT
22
23
  metadata: {}
23
24
  post_install_message:
24
25
  rdoc_options: []