Module: ClassX::Pluggable::Plugin
- Extended by:
- Attributes
- Defined in:
- lib/classx/pluggable/plugin.rb
Defined Under Namespace
Modules: AutoRegister, ClassMethods
Instance Method Summary collapse
- #inspect ⇒ Object
-
#register ⇒ Object
Abstract method for calling from context instance automatically that you should implement like followings:.
Instance Method Details
#inspect ⇒ Object
32 33 34 35 36 |
# File 'lib/classx/pluggable/plugin.rb', line 32 def inspect hash = self.to_hash hash.delete("context") "#{self.class}: #{hash.inspect}" end |
#register ⇒ Object
Abstract method for calling from context instance automatically that you should implement like followings:
def register
add_event('SOME_EVENT', 'on_some_event')
end
def on_some_event
# do something.
end
28 29 30 |
# File 'lib/classx/pluggable/plugin.rb', line 28 def register raise NotImprementedError end |