Class: Redirus::Worker::AddProxy::Action
- Inherits:
-
Object
- Object
- Redirus::Worker::AddProxy::Action
- Includes:
- Utils
- Defined in:
- lib/redirus/worker/add_proxy.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#workers ⇒ Object
readonly
Returns the value of attribute workers.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, workers, type, location_props, options = {}) ⇒ Action
constructor
A new instance of Action.
Methods included from Utils
#config, #config_file_path, #full_name
Constructor Details
#initialize(name, workers, type, location_props, options = {}) ⇒ Action
Returns a new instance of Action.
16 17 18 19 20 21 22 |
# File 'lib/redirus/worker/add_proxy.rb', line 16 def initialize(name, workers, type, location_props, = {}) @name = name @workers = workers @type = type @location_properties = location_properties(location_props) || [] @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/redirus/worker/add_proxy.rb', line 24 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
24 25 26 |
# File 'lib/redirus/worker/add_proxy.rb', line 24 def type @type end |
#workers ⇒ Object (readonly)
Returns the value of attribute workers.
24 25 26 |
# File 'lib/redirus/worker/add_proxy.rb', line 24 def workers @workers end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 30 31 |
# File 'lib/redirus/worker/add_proxy.rb', line 26 def execute File.open(config_file_path(name, type), 'w') do |file| erb = ERB.new(template, nil, '-') file.write erb.result(binding) end end |