Module: RedminePluginKit::PluginBase::ClassMethods
- Defined in:
- lib/redmine_plugin_kit/plugin_base.rb
Instance Method Summary collapse
- #loader ⇒ Object
- #plugin_id ⇒ Object
-
#setting(value) ⇒ Object
support with default setting as fall back.
- #setting?(value) ⇒ Boolean
- #setup!(existing_loader = nil) ⇒ Object
Instance Method Details
#loader ⇒ Object
22 23 24 |
# File 'lib/redmine_plugin_kit/plugin_base.rb', line 22 def loader @loader ||= RedminePluginKit::Loader.new plugin_id: plugin_id end |
#plugin_id ⇒ Object
18 19 20 |
# File 'lib/redmine_plugin_kit/plugin_base.rb', line 18 def plugin_id to_s.underscore end |
#setting(value) ⇒ Object
support with default setting as fall back
27 28 29 30 31 32 33 |
# File 'lib/redmine_plugin_kit/plugin_base.rb', line 27 def setting(value) if settings.key? value settings[value] else loader.default_settings[value] end end |
#setting?(value) ⇒ Boolean
35 36 37 |
# File 'lib/redmine_plugin_kit/plugin_base.rb', line 35 def setting?(value) RedminePluginKit.true? setting(value) end |
#setup!(existing_loader = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/redmine_plugin_kit/plugin_base.rb', line 10 def setup!(existing_loader = nil) init_loader existing_loader raise "no loader for #{plugin_id}" if loader.nil? setup_required_plugins setup end |