Module IOExtras::AbstractOutputStream
In: lib/zip/ioextras.rb

Implements many of the output convenience methods of IO. relies on <<

Methods

print   printf   putc   puts   write  

Included Modules

FakeIO

Public Instance methods

[Source]

# File lib/zip/ioextras.rb, line 130
    def print(*params)
      self << params.to_s << $\.to_s
    end

[Source]

# File lib/zip/ioextras.rb, line 134
    def printf(aFormatString, *params)
      self << sprintf(aFormatString, *params)
    end

[Source]

# File lib/zip/ioextras.rb, line 138
    def putc(anObject)
      self << case anObject
              when Fixnum then anObject.chr
              when String then anObject
              else raise TypeError, "putc: Only Fixnum and String supported"
              end
      anObject
    end

[Source]

# File lib/zip/ioextras.rb, line 147
    def puts(*params)
      params << "\n" if params.empty?
      params.flatten.each {
        |element|
        val = element.to_s
        self << val
        self << "\n" unless val[-1,1] == "\n"
      }
    end

[Source]

# File lib/zip/ioextras.rb, line 124
    def write(data)
      self << data
      data.to_s.length
    end

[Validate]