class Puppet::FileBucket::File::StringContents

Public Class Methods

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

Public Instance Methods

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