Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 479 Bytes
require 'stringio'
module Joint
class IO
attr_accessor :name, :content, :type, :size
def initialize(attrs={})
attrs.each { |key, value| send("#{key}=", value) }
@type ||= 'plain/text'
end
def content=(value)
@io = StringIO.new(value || nil)
@size = value ? value.size : 0
end
def read(*args)
@io.read(*args)
end
def rewind
@io.rewind if @io.respond_to?(:rewind)
end
alias path name
end
end
Jump to Line
Something went wrong with that request. Please try again.