Module: ClassX::Pluggable::Plugin

Extended by:
Attributes
Defined in:
lib/classx/pluggable/plugin.rb

Defined Under Namespace

Modules: AutoRegister, ClassMethods

Instance Method Summary collapse

Instance Method Details

#inspectObject



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

#registerObject

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

Raises:

  • (NotImprementedError)


28
29
30
# File 'lib/classx/pluggable/plugin.rb', line 28

def register
  raise NotImprementedError
end