Class: TimeSeq

Inherits:
Enumerator::Lazy
  • Object
show all
Defined in:
lib/time_seq.rb,
lib/time_seq/version.rb

Constant Summary collapse

Attrs =
%w{from step to}.tap do |attrs|
  attrs.each do |attr|
    attr_accessor attr
    private attr + '='
  end
end
VERSION =
"0.1.3"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initObject



7
# File 'lib/time_seq.rb', line 7

alias_method :init, :new

.new(opt = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/time_seq.rb', line 10

def new(opt={})
  init(nil).tap do |time_seq|
	time_seq.instance_eval do
      extract opt
      build_enum
    end
  end
end

Instance Method Details

#inspectObject



27
28
29
# File 'lib/time_seq.rb', line 27

def inspect
  "#<#{self.class}:#{object_id} #{inspect_attrs}>"
end