Class: Refinery::Plugin
- Inherits:
-
Object
- Object
- Refinery::Plugin
- Defined in:
- vendor/plugins/refinery/lib/refinery/plugin.rb
Instance Attribute Summary collapse
-
#always_allow_access ⇒ Object
Returns the value of attribute always_allow_access.
-
#description ⇒ Object
Returns the value of attribute description.
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#hide_from_menu ⇒ Object
Returns the value of attribute hide_from_menu.
-
#menu_match ⇒ Object
Returns the value of attribute menu_match.
-
#plugin_activity ⇒ Object
Returns the value of attribute plugin_activity.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #activity ⇒ Object
- #activity=(activities) ⇒ Object
- #add_activity(options) ⇒ Object
- #highlighted?(params) ⇒ Boolean
-
#initialize ⇒ Plugin
constructor
A new instance of Plugin.
Constructor Details
#initialize ⇒ Plugin
Returns a new instance of Plugin.
10 11 12 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 10 def initialize Refinery::Plugins.registered << self # add me to the collection of registered plugins end |
Instance Attribute Details
#always_allow_access ⇒ Object
Returns the value of attribute always_allow_access.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def always_allow_access @always_allow_access end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def description @description end |
#directory ⇒ Object
Returns the value of attribute directory.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def directory @directory end |
#hide_from_menu ⇒ Object
Returns the value of attribute hide_from_menu.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def @hide_from_menu end |
#menu_match ⇒ Object
Returns the value of attribute menu_match.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def @menu_match end |
#plugin_activity ⇒ Object
Returns the value of attribute plugin_activity.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def plugin_activity @plugin_activity end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
8 9 10 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 8 def version @version end |
Class Method Details
.register {|self.new| ... } ⇒ Object
4 5 6 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 4 def self.register(&block) yield self.new end |
Instance Method Details
#activity ⇒ Object
18 19 20 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 18 def activity self.plugin_activity ||= [] end |
#activity=(activities) ⇒ Object
22 23 24 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 22 def activity=(activities) [activities].flatten.each { |activity| add_activity(activity) } end |
#add_activity(options) ⇒ Object
26 27 28 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 26 def add_activity() (self.plugin_activity ||= []) << Activity::new() end |
#highlighted?(params) ⇒ Boolean
14 15 16 |
# File 'vendor/plugins/refinery/lib/refinery/plugin.rb', line 14 def highlighted?(params) params[:controller] =~ self. end |