Class: Chef::FileContentManagement::ContentBase
- Inherits:
-
Object
- Object
- Chef::FileContentManagement::ContentBase
- Defined in:
- lib/chef/file_content_management/content_base.rb
Direct Known Subclasses
Provider::CookbookFile::Content, Provider::File::Content, Provider::RemoteFile::Content, Provider::Template::Content
Instance Attribute Summary collapse
-
#current_resource ⇒ Object
readonly
Returns the value of attribute current_resource.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#new_resource ⇒ Object
readonly
Returns the value of attribute new_resource.
-
#run_context ⇒ Object
readonly
Returns the value of attribute run_context.
Instance Method Summary collapse
-
#initialize(new_resource, current_resource, run_context, logger = Chef::Log.with_child) ⇒ ContentBase
constructor
A new instance of ContentBase.
- #tempfile ⇒ Object
Constructor Details
#initialize(new_resource, current_resource, run_context, logger = Chef::Log.with_child) ⇒ ContentBase
Returns a new instance of ContentBase.
28 29 30 31 32 33 34 |
# File 'lib/chef/file_content_management/content_base.rb', line 28 def initialize(new_resource, current_resource, run_context, logger = Chef::Log.with_child) @new_resource = new_resource @current_resource = current_resource @run_context = run_context @tempfile_loaded = false @logger = logger end |
Instance Attribute Details
#current_resource ⇒ Object (readonly)
Returns the value of attribute current_resource.
25 26 27 |
# File 'lib/chef/file_content_management/content_base.rb', line 25 def current_resource @current_resource end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
26 27 28 |
# File 'lib/chef/file_content_management/content_base.rb', line 26 def logger @logger end |
#new_resource ⇒ Object (readonly)
Returns the value of attribute new_resource.
24 25 26 |
# File 'lib/chef/file_content_management/content_base.rb', line 24 def new_resource @new_resource end |
#run_context ⇒ Object (readonly)
Returns the value of attribute run_context.
23 24 25 |
# File 'lib/chef/file_content_management/content_base.rb', line 23 def run_context @run_context end |
Instance Method Details
#tempfile ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/chef/file_content_management/content_base.rb', line 36 def tempfile # tempfile may be nil, so we cannot use ||= here if @tempfile_loaded @tempfile else @tempfile_loaded = true @tempfile = file_for_provider end end |