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.
20 21 22 23 24 |
# File 'lib/rom/plugin_base.rb', line 20 def initialize(mod, ) @mod = mod @options = @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.
9 10 11 |
# File 'lib/rom/plugin_base.rb', line 9 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.
14 15 16 |
# File 'lib/rom/plugin_base.rb', line 14 def @options 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.
17 18 19 |
# File 'lib/rom/plugin_base.rb', line 17 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
41 42 43 |
# File 'lib/rom/plugin_base.rb', line 41 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.
27 28 29 |
# File 'lib/rom/plugin_base.rb', line 27 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.
32 33 34 |
# File 'lib/rom/plugin_base.rb', line 32 def schema? type == :schema end |