Class: Chrono::Fields::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/chrono/fields/base.rb

Direct Known Subclasses

Day, Hour, Minute, Month, Wday

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/chrono/fields/base.rb', line 6

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



4
5
6
# File 'lib/chrono/fields/base.rb', line 4

def source
  @source
end

Instance Method Details

#to_aObject



10
11
12
13
14
15
16
# File 'lib/chrono/fields/base.rb', line 10

def to_a
  if has_multiple_elements?
    fields.map(&:to_a).flatten.uniq.sort
  else
    lower.step(upper, step).to_a.sort
  end
end