lib/itamae/recipe.rb in itamae-1.0.0.beta38 vs lib/itamae/recipe.rb in itamae-1.0.0.beta39
- old
+ new
@@ -40,9 +40,16 @@
def load_children
instance_eval(File.read(@path), @path, 1)
end
+ def respond_to_missing?(method, include_private = false)
+ Resource.get_resource_class(method)
+ true
+ rescue NameError
+ false
+ end
+
def method_missing(method, name, &block)
klass = Resource.get_resource_class(method)
resource = klass.new(self, name, &block)
@children << resource
end