Module: Arver::NodeWithScriptHooks
Instance Attribute Summary collapse
-
#post_close ⇒ Object
Returns the value of attribute post_close.
-
#post_open ⇒ Object
Returns the value of attribute post_open.
-
#pre_close ⇒ Object
Returns the value of attribute pre_close.
-
#pre_open ⇒ Object
Returns the value of attribute pre_open.
Instance Method Summary collapse
Instance Attribute Details
#post_close ⇒ Object
Returns the value of attribute post_close.
3 4 5 |
# File 'lib/arver/node_with_script_hooks.rb', line 3 def post_close @post_close end |
#post_open ⇒ Object
Returns the value of attribute post_open.
3 4 5 |
# File 'lib/arver/node_with_script_hooks.rb', line 3 def post_open @post_open end |
#pre_close ⇒ Object
Returns the value of attribute pre_close.
3 4 5 |
# File 'lib/arver/node_with_script_hooks.rb', line 3 def pre_close @pre_close end |
#pre_open ⇒ Object
Returns the value of attribute pre_open.
3 4 5 |
# File 'lib/arver/node_with_script_hooks.rb', line 3 def pre_open @pre_open end |
Instance Method Details
#script_hooks_from_hash(hash) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/arver/node_with_script_hooks.rb', line 12 def script_hooks_from_hash( hash ) hash.each do | name, data | self.pre_open= data if name == "pre_open" self.pre_close= data if name == "pre_close" self.post_open= data if name == "post_open" self.post_close= data if name == "post_close" end hash.delete("pre_open") hash.delete("pre_close") hash.delete("post_open") hash.delete("post_close") end |
#script_hooks_to_yaml ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/arver/node_with_script_hooks.rb', line 4 def script_hooks_to_yaml yaml = "" yaml << "'pre_open': '#{pre_open}'\n" unless pre_open.nil? yaml << "'pre_close': '#{pre_close}'\n" unless pre_close.nil? yaml << "'post_open': '#{post_open}'\n" unless post_open.nil? yaml << "'post_close': '#{post_close}'\n" unless post_close.nil? yaml end |