Class: Chrono::Fields::Base
- Inherits:
-
Object
- Object
- Chrono::Fields::Base
- Defined in:
- lib/chrono/fields/base.rb
Defined Under Namespace
Classes: InvalidField
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.
15 16 17 |
# File 'lib/chrono/fields/base.rb', line 15 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
13 14 15 |
# File 'lib/chrono/fields/base.rb', line 13 def source @source end |
Instance Method Details
#to_a ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/chrono/fields/base.rb', line 19 def to_a if has_multiple_elements? fields.map(&:to_a).flatten.uniq.sort else validate! wildcard? ? [] : lower.step(upper, step).to_a.sort end end |