Class: Upcoming::Generator
- Inherits:
-
Object
- Object
- Upcoming::Generator
- Defined in:
- lib/upcoming/generators/generator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#choose ⇒ Object
readonly
Returns the value of attribute choose.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Generator
constructor
A new instance of Generator.
- #step(from) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Generator
Returns a new instance of Generator.
5 6 7 |
# File 'lib/upcoming/generators/generator.rb', line 5 def initialize( = {}) @choose = .fetch(:choose, :upcoming) end |
Instance Attribute Details
#choose ⇒ Object (readonly)
Returns the value of attribute choose.
3 4 5 |
# File 'lib/upcoming/generators/generator.rb', line 3 def choose @choose end |
Instance Method Details
#step(from) ⇒ Object
9 10 11 |
# File 'lib/upcoming/generators/generator.rb', line 9 def step(from) date_range(from).find { |date| valid?(date) } end |