time_seq 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -8
- data/lib/time_seq/version.rb +1 -1
- data/lib/time_seq.rb +14 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4a6d9b7c6aa42b4be3fc512c9666e69ada37c70
|
4
|
+
data.tar.gz: 0e107036ca4831c4d3fc65337bc5d0e464806c94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdc76e2d6d9bb72a29c8b935749556c165884ebb7047807449a8510a53945ca3b96b9aeaeda97eb81aa2dae422e3dc193863a3df5169910130053a0729d8b05d
|
7
|
+
data.tar.gz: 01e779cc198833a4d67ac8b8f8fbbfc15a1b69d14663f9edfeb9926575d20c49ecad33366204d20b046163d3e0cfcc61e1b4b49c5dc686dd6112524ab5d776b0
|
data/.gitignore
CHANGED
data/lib/time_seq/version.rb
CHANGED
data/lib/time_seq.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
require 'active_support/core_ext/integer/time'
|
2
|
-
require 'forwardable'
|
3
2
|
|
4
|
-
class TimeSeq
|
3
|
+
class TimeSeq < DelegateClass(Enumerator::Lazy)
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
class << self
|
6
|
+
|
7
|
+
alias_method :init, :new
|
8
|
+
|
9
|
+
def new(opt={})
|
10
|
+
init(nil).instance_eval do
|
11
|
+
extract opt
|
12
|
+
build_enum
|
13
|
+
end
|
14
|
+
end
|
9
15
|
end
|
10
16
|
|
11
17
|
Attrs = %w{from step to}.tap do |attrs|
|
@@ -15,13 +21,6 @@ class TimeSeq
|
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
18
|
-
extend Forwardable
|
19
|
-
def_delegators :@e, *(
|
20
|
-
Enumerator.instance_methods(false) |
|
21
|
-
Enumerator::Lazy.instance_methods(false) |
|
22
|
-
Enumerable.instance_methods
|
23
|
-
)
|
24
|
-
|
25
24
|
def inspect
|
26
25
|
"#<#{self.class}:#{object_id} #{inspect_attrs}>"
|
27
26
|
end
|
@@ -43,6 +42,7 @@ class TimeSeq
|
|
43
42
|
break if to and time_point > to
|
44
43
|
end
|
45
44
|
end.lazy
|
45
|
+
__setobj__ @e
|
46
46
|
end
|
47
47
|
|
48
48
|
def inspect_attrs
|
@@ -53,3 +53,5 @@ class TimeSeq
|
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
56
|
+
|
57
|
+
require 'time_seq/version'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_seq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.6.7
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: generate a (infinite) time sequence
|