summaryrefslogtreecommitdiffstats
path: root/lib/models/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/plugin.js')
-rw-r--r--lib/models/plugin.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/models/plugin.js b/lib/models/plugin.js
index 6d322f4..2f791dc 100644
--- a/lib/models/plugin.js
+++ b/lib/models/plugin.js
@@ -1,5 +1,6 @@
var Immutable = require('immutable');
+var TemplateBlock = require('./templateBlock');
var PREFIX = require('../constants/pluginPrefix');
var DEFAULT_VERSION = '*';
@@ -73,6 +74,29 @@ Plugin.prototype.getHooks = function() {
};
/**
+ Return map of filters
+ @return {Map<String:Function>}
+*/
+Plugin.prototype.getFilters = function() {
+ return this.getContent().get('filters');
+};
+
+/**
+ Return map of blocks
+ @return {List<TemplateBlock>}
+*/
+Plugin.prototype.getBlocks = function() {
+ var blocks = this.getContent().get('blocks');
+
+ return blocks
+ .map(function(block, blockName) {
+ block.name = blockName;
+ return new TemplateBlock(block);
+ })
+ .toList();
+};
+
+/**
Return a specific hook
@param {String} name