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.
-
#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) ⇒ ContentBase
constructor
A new instance of ContentBase.
- #tempfile ⇒ Object
Constructor Details
#initialize(new_resource, current_resource, run_context) ⇒ ContentBase
Returns a new instance of ContentBase.
27 28 29 30 31 32 |
# File 'lib/chef/file_content_management/content_base.rb', line 27 def initialize(new_resource, current_resource, run_context) @new_resource = new_resource @current_resource = current_resource @run_context = run_context @tempfile_loaded = false 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 |
#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
34 35 36 37 38 39 40 41 42 |
# File 'lib/chef/file_content_management/content_base.rb', line 34 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 |