Class: Elasticband::Filter::Script
- Inherits:
-
Elasticband::Filter
- Object
- Elasticband::Filter
- Elasticband::Filter::Script
- Defined in:
- lib/elasticband/filter/script.rb
Constant Summary
Constants inherited from Elasticband::Filter
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#script ⇒ Object
Returns the value of attribute script.
Attributes inherited from Elasticband::Filter
Instance Method Summary collapse
-
#initialize(script, params = {}) ⇒ Script
constructor
A new instance of Script.
- #to_h ⇒ Object
Methods inherited from Elasticband::Filter
Constructor Details
#initialize(script, params = {}) ⇒ Script
Returns a new instance of Script.
6 7 8 9 |
# File 'lib/elasticband/filter/script.rb', line 6 def initialize(script, params = {}) self.script = script self.params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
4 5 6 |
# File 'lib/elasticband/filter/script.rb', line 4 def params @params end |
#script ⇒ Object
Returns the value of attribute script.
4 5 6 |
# File 'lib/elasticband/filter/script.rb', line 4 def script @script end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 |
# File 'lib/elasticband/filter/script.rb', line 11 def to_h return {} unless script { script: { script: script }.merge(params_hash) } end |