Method: Chef::Resource#initialize
- Defined in:
- lib/chef/resource.rb
#initialize(name, collection = nil, node = nil) ⇒ Resource
Returns a new instance of Resource.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/chef/resource.rb', line 38 def initialize(name, collection=nil, node=nil) @name = name if collection @collection = collection else @collection = Chef::ResourceCollection.new() end @node = node ? node : Chef::Node.new @noop = nil @before = nil @actions = Hash.new @params = Hash.new @provider = nil @allowed_actions = [ :nothing ] @action = :nothing @updated = false @supports = {} @ignore_failure = false @not_if = nil @only_if = nil sline = caller(4).shift if sline @source_line = sline.gsub!(/^(.+):(.+):.+$/, '\1 line \2') @source_line = ::File.(@source_line) if @source_line end end |