Class: Chrono::Fields::Base
- Inherits:
-
Object
- Object
- Chrono::Fields::Base
- Defined in:
- lib/chrono/fields/base.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ Base
constructor
A new instance of Base.
- #to_a ⇒ Object
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
#source ⇒ Object (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_a ⇒ Object
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 |