Class: Dimples::Plugin
- Inherits:
-
Object
- Object
- Dimples::Plugin
- Defined in:
- lib/dimples/plugin.rb
Overview
A Ruby class that can receive events from Dimples as a site is processed.
Constant Summary collapse
- EVENTS =
i[ before_file_scanning after_file_scanning before_publishing after_publishing before_post_write before_page_write after_post_write after_page_write ].freeze
Class Attribute Summary collapse
-
.subclasses ⇒ Object
readonly
Returns the value of attribute subclasses.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(site) ⇒ Plugin
constructor
A new instance of Plugin.
- #process(event, item) ⇒ Object
- #supported_events ⇒ Object
- #supports_event?(event) ⇒ Boolean
Constructor Details
#initialize(site) ⇒ Plugin
25 26 27 |
# File 'lib/dimples/plugin.rb', line 25 def initialize(site) @site = site end |
Class Attribute Details
.subclasses ⇒ Object (readonly)
Returns the value of attribute subclasses.
18 19 20 |
# File 'lib/dimples/plugin.rb', line 18 def subclasses @subclasses end |
Class Method Details
.inherited(subclass) ⇒ Object
21 22 23 |
# File 'lib/dimples/plugin.rb', line 21 def self.inherited(subclass) (@subclasses ||= []) << subclass end |
Instance Method Details
#process(event, item) ⇒ Object
29 |
# File 'lib/dimples/plugin.rb', line 29 def process(event, item); end |
#supported_events ⇒ Object
31 32 33 |
# File 'lib/dimples/plugin.rb', line 31 def supported_events [] end |
#supports_event?(event) ⇒ Boolean
35 36 37 |
# File 'lib/dimples/plugin.rb', line 35 def supports_event?(event) supported_events.include?(event) end |