Class: Avo::Plugin
- Inherits:
-
Object
- Object
- Avo::Plugin
- Defined in:
- lib/avo/plugin.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ Plugin
constructor
A new instance of Plugin.
Constructor Details
#initialize(&block) ⇒ Plugin
Returns a new instance of Plugin.
3 4 |
# File 'lib/avo/plugin.rb', line 3 def initialize(*, **, &block) end |
Class Method Details
.engine ⇒ Object
17 18 19 |
# File 'lib/avo/plugin.rb', line 17 def engine "#{namespace}::Engine".safe_constantize end |
.gemspec ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/avo/plugin.rb', line 27 def gemspec return if engine.blank? gemspec_path = Dir["#{engine.root}/*.gemspec"].first Gem::Specification::load(gemspec_path) end |
.name ⇒ Object
7 8 9 10 11 |
# File 'lib/avo/plugin.rb', line 7 def name return gemspec.name if gemspec.present? self.to_s.split("::").first end |
.namespace ⇒ Object
21 22 23 24 25 |
# File 'lib/avo/plugin.rb', line 21 def namespace modules = to_s.split("::") modules.pop modules.join("::") end |
.version ⇒ Object
13 14 15 |
# File 'lib/avo/plugin.rb', line 13 def version "#{namespace}::VERSION".safe_constantize end |