Class: BPM::PluginContext
- Inherits:
-
Object
- Object
- BPM::PluginContext
- Defined in:
- lib/bpm/pipeline/plugin_context.rb
Instance Attribute Summary collapse
-
#moduleId ⇒ Object
readonly
Returns the value of attribute moduleId.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(pkg, module_id = nil) ⇒ PluginContext
constructor
A new instance of PluginContext.
- #minify_as_js ⇒ Object
- #settings ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(pkg, module_id = nil) ⇒ PluginContext
Returns a new instance of PluginContext.
8 9 10 11 12 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 8 def initialize(pkg, module_id=nil) @generating_asset = BPM::GeneratedAsset. @package = pkg.as_json @moduleId = module_id end |
Instance Attribute Details
#moduleId ⇒ Object (readonly)
Returns the value of attribute moduleId.
5 6 7 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 5 def moduleId @moduleId end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
6 7 8 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 6 def package @package end |
Instance Method Details
#as_json ⇒ Object
22 23 24 25 26 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 22 def as_json { :package => @package, :moduleId => @moduleId, :settings => settings } end |
#minify_as_js ⇒ Object
14 15 16 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 14 def minify_as_js @generating_asset ? @generating_asset.minify_as_js : "CTX.minify=function(body) { return body; }" end |
#settings ⇒ Object
18 19 20 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 18 def settings @generating_asset ? @generating_asset.build_settings : {} end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/bpm/pipeline/plugin_context.rb', line 28 def to_json as_json.to_json end |