Class: Elasticband::Filter::Script

Inherits:
Elasticband::Filter show all
Defined in:
lib/elasticband/filter/script.rb

Constant Summary

Constants inherited from Elasticband::Filter

PARSE_FILTERS

Instance Attribute Summary collapse

Attributes inherited from Elasticband::Filter

#options

Instance Method Summary collapse

Methods inherited from Elasticband::Filter

parse, #parse

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

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/elasticband/filter/script.rb', line 4

def params
  @params
end

#scriptObject

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_hObject



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