Class: Pieces::Listener
- Inherits:
-
Object
- Object
- Pieces::Listener
- Includes:
- Configurable
- Defined in:
- lib/pieces/listener.rb
Instance Attribute Summary
Attributes included from Configurable
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Listener
constructor
A new instance of Listener.
- #listen ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Listener
Returns a new instance of Listener.
11 12 13 14 |
# File 'lib/pieces/listener.rb', line 11 def initialize(config = {}) super build_pieces end |
Class Method Details
.listen(config = {}) ⇒ Object
5 6 7 |
# File 'lib/pieces/listener.rb', line 5 def self.listen(config = {}) new(Config.new(config)).listen end |
Instance Method Details
#listen ⇒ Object
16 17 18 19 20 |
# File 'lib/pieces/listener.rb', line 16 def listen Listen.to(*paths, force_polling: config.force_polling?) do rebuild_pieces end.tap(&:start) end |