Module: Setsuzoku::Pluggable::ClassMethods
- Extended by:
- T::Sig
- Defined in:
- lib/setsuzoku/pluggable.rb
Instance Method Summary collapse
- #default_options ⇒ Object
-
#final ⇒ Void
Upon class load (or whenever you call this) register the core configuration for the pluggable class.
- #plugin_class ⇒ Object
- #plugin_class=(val) ⇒ Object
- #plugin_context ⇒ Object
- #plugin_context=(val) ⇒ Object
- #register_plugin(**options) ⇒ Object
Instance Method Details
#default_options ⇒ Object
52 53 54 55 56 |
# File 'lib/setsuzoku/pluggable.rb', line 52 def { plugin_class: self } end |
#final ⇒ Void
Upon class load (or whenever you call this) register the core configuration for the pluggable class.
param options [Any] a list of keyword options to be passed in to customize registration.
64 |
# File 'lib/setsuzoku/pluggable.rb', line 64 sig(:final) { params(options: T.untyped).void } |
#plugin_class ⇒ Object
45 46 47 |
# File 'lib/setsuzoku/pluggable.rb', line 45 def plugin_class @plugin_class end |
#plugin_class=(val) ⇒ Object
48 49 50 |
# File 'lib/setsuzoku/pluggable.rb', line 48 def plugin_class=(val) @plugin_class = val end |
#plugin_context ⇒ Object
39 40 41 |
# File 'lib/setsuzoku/pluggable.rb', line 39 def plugin_context @plugin_context end |
#plugin_context=(val) ⇒ Object
42 43 44 |
# File 'lib/setsuzoku/pluggable.rb', line 42 def plugin_context=(val) @plugin_context = val end |
#register_plugin(**options) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/setsuzoku/pluggable.rb', line 65 def register_plugin(**) [:plugin_class].config_context[:required_instance_methods].each do |req_method| next if [:required_instance_methods].key?(req_method) raise Setsuzoku::Exception::UndefinedRequiredMethod.new( registering_instance: self, plugin_class: [:plugin_class], method_name: req_method ) end self.plugin_context = self..merge() end |