Class: Mengpaneel::Flusher
- Inherits:
-
Object
- Object
- Mengpaneel::Flusher
- Defined in:
- lib/mengpaneel/flusher.rb
Constant Summary collapse
- STRATEGIES =
[ Strategy::Delayed, Strategy::ClientSide, Strategy::CapableClientSide, Strategy::AsyncServerSide, Strategy::ServerSide ]
Instance Attribute Summary collapse
-
#manager ⇒ Object
readonly
Returns the value of attribute manager.
Instance Method Summary collapse
-
#initialize(manager) ⇒ Flusher
constructor
A new instance of Flusher.
- #run ⇒ Object
Constructor Details
#initialize(manager) ⇒ Flusher
Returns a new instance of Flusher.
19 20 21 |
# File 'lib/mengpaneel/flusher.rb', line 19 def initialize(manager) @manager = manager end |
Instance Attribute Details
#manager ⇒ Object (readonly)
Returns the value of attribute manager.
17 18 19 |
# File 'lib/mengpaneel/flusher.rb', line 17 def manager @manager end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mengpaneel/flusher.rb', line 23 def run return unless Mengpaneel.token if manager.flushing_strategy strategy = Strategy.const_get(manager.flushing_strategy.to_s.classify) flush_using(strategy) else STRATEGIES.find { |strategy| flush_using(strategy) } end end |