Methods
- ==
- aopen
- copy_to
- cp
- eql?
- hash
- inspect
- move_to
- new
- read_all
- remove
- reproducible?
- rm
- ropen
- size
- string
- to_s
- wopen
Public Class methods
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 299
299: def initialize( str = '' )
300: @buffer = str
301: super()
302: end
Public Instance methods
This method is also aliased as
eql?
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 318
318: def ==( other )
319: StringPort === other and @buffer.equal? other.string
320: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 346
346: def aopen( &block )
347: @buffer ||= ''
348: StringOutput.new(@buffer, &block)
349: end
This method is also aliased as
cp
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 357
357: def copy_to( port )
358: port.wopen {|f|
359: f.write @buffer
360: }
361: end
Alias for copy_to
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 324
324: def hash
325: @buffer.object_id.hash
326: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 328
328: def inspect
329: "#<#{self.class}:id=#{sprintf '0x%x', @buffer.object_id}>"
330: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 365
365: def move_to( port )
366: if StringPort === port
367: str = @buffer
368: port.instance_eval { @buffer = str }
369: else
370: copy_to port
371: end
372: remove
373: end
Alias for to_s
This method is also aliased as
rm
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 351
351: def remove
352: @buffer = nil
353: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 332
332: def reproducible?
333: true
334: end
Alias for remove
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 336
336: def ropen( &block )
337: @buffer or raise Errno::ENOENT, "#{inspect} is already removed"
338: StringInput.open(@buffer, &block)
339: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 314
314: def size
315: @buffer.size
316: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 304
304: def string
305: @buffer
306: end
This method is also aliased as
read_all
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 308
308: def to_s
309: @buffer.dup
310: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 341
341: def wopen( &block )
342: @buffer = ''
343: StringOutput.new(@buffer, &block)
344: end