Class: Caffeinate::Configuration
- Inherits:
-
Object
- Object
- Caffeinate::Configuration
- Defined in:
- lib/caffeinate/configuration.rb
Instance Attribute Summary collapse
-
#async_delivery ⇒ Object
Returns the value of attribute async_delivery.
-
#mailing_job ⇒ Object
Returns the value of attribute mailing_job.
-
#now ⇒ Object
Returns the value of attribute now.
Instance Method Summary collapse
-
#async_delivery? ⇒ Boolean
If delivery is asyncronous.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#mailing_job_class ⇒ Object
The @mailing_job constantized.
-
#time_now ⇒ Object
The current time, for database calls.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 |
# File 'lib/caffeinate/configuration.rb', line 7 def initialize @now = -> { Time.current } @async_delivery = false @mailing_job = nil end |
Instance Attribute Details
#async_delivery ⇒ Object
Returns the value of attribute async_delivery.
5 6 7 |
# File 'lib/caffeinate/configuration.rb', line 5 def async_delivery @async_delivery end |
#mailing_job ⇒ Object
Returns the value of attribute mailing_job.
5 6 7 |
# File 'lib/caffeinate/configuration.rb', line 5 def mailing_job @mailing_job end |
#now ⇒ Object
Returns the value of attribute now.
5 6 7 |
# File 'lib/caffeinate/configuration.rb', line 5 def now @now end |
Instance Method Details
#async_delivery? ⇒ Boolean
If delivery is asyncronous
25 26 27 |
# File 'lib/caffeinate/configuration.rb', line 25 def async_delivery? @async_delivery end |
#mailing_job_class ⇒ Object
The @mailing_job constantized. Only used if ‘async_delivery = true`
30 31 32 |
# File 'lib/caffeinate/configuration.rb', line 30 def mailing_job_class @mailing_job.constantize end |
#time_now ⇒ Object
The current time, for database calls
20 21 22 |
# File 'lib/caffeinate/configuration.rb', line 20 def time_now @now.call end |