Class: ROM::PluginBase
- Inherits:
-
Object
- Object
- ROM::PluginBase
- Defined in:
- lib/rom/plugin_base.rb
Overview
Abstract plugin base
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mod ⇒ Module
readonly
private
A module representing the plugin.
-
#options ⇒ Hash
readonly
private
Configuration options.
- #type ⇒ Object readonly private
Instance Method Summary collapse
-
#apply_to(_base) ⇒ Object
private
Apply this plugin to the provided class.
-
#initialize(mod, options) ⇒ PluginBase
constructor
private
A new instance of PluginBase.
- #relation? ⇒ Boolean private
- #schema? ⇒ Boolean private
Constructor Details
#initialize(mod, options) ⇒ PluginBase
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PluginBase.
22 23 24 25 26 |
# File 'lib/rom/plugin_base.rb', line 22 def initialize(mod, ) @mod = mod = @type = .fetch(:type) end |
Instance Attribute Details
#mod ⇒ Module (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a module representing the plugin.
11 12 13 |
# File 'lib/rom/plugin_base.rb', line 11 def mod @mod end |
#options ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns configuration options.
16 17 18 |
# File 'lib/rom/plugin_base.rb', line 16 def end |
#type ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/rom/plugin_base.rb', line 19 def type @type end |
Instance Method Details
#apply_to(_base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Apply this plugin to the provided class
43 44 45 |
# File 'lib/rom/plugin_base.rb', line 43 def apply_to(_base) raise NotImplementedError, "#{self.class}#apply_to not implemented" end |
#relation? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/rom/plugin_base.rb', line 29 def relation? type == :relation end |
#schema? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/rom/plugin_base.rb', line 34 def schema? type == :schema end |