Module: BBB::Components::Pinnable::ClassMethods
- Defined in:
- lib/BBB/components/pinnable.rb
Instance Method Summary collapse
-
#after_connect(callback) ⇒ Object
Register callbacks.
-
#after_connect_callbacks ⇒ Object
Convenience function on class level that holds the callbacks (anything that responds to call OR a symbol) that need to be called after the pins get connected.
-
#pin_classes ⇒ Object
Attribute reader to the class level @pins.
-
#uses(*classes) ⇒ Object
Register the use of classes of pins to a class.
Instance Method Details
#after_connect(callback) ⇒ Object
Register callbacks
31 32 33 |
# File 'lib/BBB/components/pinnable.rb', line 31 def after_connect(callback) after_connect_callbacks << callback end |
#after_connect_callbacks ⇒ Object
Convenience function on class level that holds the callbacks (anything that responds to call OR a symbol) that need to be called after the pins get connected.
40 41 42 |
# File 'lib/BBB/components/pinnable.rb', line 40 def after_connect_callbacks @after_connect_callbacks ||= [] end |
#pin_classes ⇒ Object
Attribute reader to the class level @pins
24 25 26 |
# File 'lib/BBB/components/pinnable.rb', line 24 def pin_classes @pin_classes ||= [] end |
#uses(*classes) ⇒ Object
Register the use of classes of pins to a class. These classes will be initialized upon #connect
15 16 17 |
# File 'lib/BBB/components/pinnable.rb', line 15 def uses(*classes) pin_classes.concat(classes) end |