Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Plugin class
- class Plugin
- @registered_plugins = {}
- @@trigger = ""
- def self.inherited(child)
- p child.trigger
- end
- def self.trigger
- @@trigger
- end
- def execute
- throw NotImplementedException.new
- end
- end
- # Some subclass of plugin class
- require 'plugin'
- class Foo < Plugin
- @@trigger = "!foo"
- def execute
- puts "moo"
- end
- end
Add Comment
Please, Sign In to add comment