module Packerman::Dsl::Node
Public Class Methods
new()
click to toggle source
# File lib/packerman/dsl/node.rb, line 4 def initialize @_hash = {} @_hash[:type] = type end
Public Instance Methods
hash_key()
click to toggle source
# File lib/packerman/dsl/node.rb, line 23 def hash_key [:type] + require_keys + optional_keys end
method_missing(method, *args)
click to toggle source
# File lib/packerman/dsl/node.rb, line 13 def method_missing(method, *args) @_hash[method] ||= args.first end
optional_keys()
click to toggle source
# File lib/packerman/dsl/node.rb, line 31 def optional_keys [] end
require_keys()
click to toggle source
# File lib/packerman/dsl/node.rb, line 27 def require_keys [] end
to_hash()
click to toggle source
# File lib/packerman/dsl/node.rb, line 17 def to_hash keys = self.class.hash_key @_hash.slice(*keys) end
type()
click to toggle source
# File lib/packerman/dsl/node.rb, line 9 def type self.class.name.demodulize.underscore end