class Puppet::FileBucket::File::StringContents

Public Class Methods

new(content) click to toggle source
   # File lib/puppet/file_bucket/file.rb
79 def initialize(content)
80   @contents = content;
81 end

Public Instance Methods

checksum_data(base_method) click to toggle source
   # File lib/puppet/file_bucket/file.rb
96 def checksum_data(base_method)
97   Puppet.info(_("Computing checksum on string"))
98   Puppet::Util::Checksums.method(base_method).call(@contents)
99 end
size() click to toggle source
   # File lib/puppet/file_bucket/file.rb
92 def size
93   @contents.size
94 end
stream(&block) click to toggle source
   # File lib/puppet/file_bucket/file.rb
83 def stream(&block)
84   s = StringIO.new(@contents)
85   begin
86     block.call(s)
87   ensure
88     s.close
89   end
90 end
to_binary() click to toggle source
    # File lib/puppet/file_bucket/file.rb
101 def to_binary
102   # This is not so horrible as for FileContent, but still possible to mutate the content that the
103   # checksum is based on... so semi horrible...
104   return @contents;
105 end