class Puppet::FileBucket::File::StringContents

Public Instance Methods

checksum_data(base_method) click to toggle source
# File lib/puppet/file_bucket/file.rb, line 123
def checksum_data(base_method)
  Puppet.info("Computing checksum on string")
  Puppet::Util::Checksums.method(base_method).call(@contents)
end
size() click to toggle source
# File lib/puppet/file_bucket/file.rb, line 119
def size
  @contents.size
end
stream(&block) click to toggle source
# File lib/puppet/file_bucket/file.rb, line 110
def stream(&block)
  s = StringIO.new(@contents)
  begin
    block.call(s)
  ensure
    s.close
  end
end
to_s() click to toggle source
# File lib/puppet/file_bucket/file.rb, line 128
def to_s
  # This is not so horrible as for FileContent, but still possible to mutate the content that the
  # checksum is based on... so semi horrible...
  return @contents;
end

Public Class Methods

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