Class: Revamp::Parser::PuppetTarball::Entry
- Inherits:
-
Object
- Object
- Revamp::Parser::PuppetTarball::Entry
- Defined in:
- lib/revamp/parser/puppet-tarball.rb
Overview
An entry from tarball
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #file? ⇒ Boolean
-
#initialize(tarfile) ⇒ Entry
constructor
A new instance of Entry.
- #metadata? ⇒ Boolean
Constructor Details
#initialize(tarfile) ⇒ Entry
Returns a new instance of Entry.
63 64 65 66 67 68 |
# File 'lib/revamp/parser/puppet-tarball.rb', line 63 def initialize(tarfile) @tarfile = tarfile @name = tarfile.full_name @content = nil @content = tarfile.read unless @tarfile.directory? end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
61 62 63 |
# File 'lib/revamp/parser/puppet-tarball.rb', line 61 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
62 63 64 |
# File 'lib/revamp/parser/puppet-tarball.rb', line 62 def name @name end |
Instance Method Details
#file? ⇒ Boolean
74 75 76 |
# File 'lib/revamp/parser/puppet-tarball.rb', line 74 def file? !content.nil? end |
#metadata? ⇒ Boolean
70 71 72 |
# File 'lib/revamp/parser/puppet-tarball.rb', line 70 def !@tarfile.directory? && name.end_with?('metadata.json') end |