Class: Recipe
- Inherits:
-
Object
- Object
- Recipe
- Defined in:
- lib/kittyverse/recipes.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
use date_start -why? why not?.
-
#time_end ⇒ Object
use date_start -why? why not?.
-
#time_start ⇒ Object
use date_start -why? why not?.
-
#traits ⇒ Object
use date_start -why? why not?.
-
#variants ⇒ Object
use date_start -why? why not?.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Recipe
constructor
A new instance of Recipe.
-
#time? ⇒ Boolean
is recipe time windowed? true/false.
- #time_days ⇒ Object
- #update(**kwargs) ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ Recipe
Returns a new instance of Recipe.
11 12 13 |
# File 'lib/kittyverse/recipes.rb', line 11 def initialize( **kwargs ) update( kwargs ) end |
Instance Attribute Details
#limit ⇒ Object
use date_start -why? why not?
5 6 7 |
# File 'lib/kittyverse/recipes.rb', line 5 def limit @limit end |
#time_end ⇒ Object
use date_start -why? why not?
5 6 7 |
# File 'lib/kittyverse/recipes.rb', line 5 def time_end @time_end end |
#time_start ⇒ Object
use date_start -why? why not?
5 6 7 |
# File 'lib/kittyverse/recipes.rb', line 5 def time_start @time_start end |
#traits ⇒ Object
use date_start -why? why not?
5 6 7 |
# File 'lib/kittyverse/recipes.rb', line 5 def traits @traits end |
#variants ⇒ Object
use date_start -why? why not?
5 6 7 |
# File 'lib/kittyverse/recipes.rb', line 5 def variants @variants end |
Instance Method Details
#time? ⇒ Boolean
is recipe time windowed? true/false
23 |
# File 'lib/kittyverse/recipes.rb', line 23 def time?() @time_start && @time_end; end |
#time_days ⇒ Object
25 |
# File 'lib/kittyverse/recipes.rb', line 25 def time_days() (@time_end.jd - @time_start.jd) + 1; end |
#update(**kwargs) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/kittyverse/recipes.rb', line 15 def update( **kwargs ) kwargs.each do |name,value| send( "#{name}=", value ) ## use "regular" plain/classic attribute setter end self ## return self for chaining end |