CKByteData

Class/Module:
Class
In:
lib/cgikit.rb
Parent:
Object

Description

CKByteData objects manage bytes.

Methods

<<
==
bytes
each
length
new
new_with_file
new_with_io
to_s
write_to_file

Attributes

content_type [RW]
Content type of the bytes.
path [RW]
Path of a file saving the bytes.

Public Class Methods

new( string = nil )
new_with_file( filename )

Create an instance from specified file.

new_with_io( io, offset = nil, count = nil )

Create an instance from specified IO object. If you give this a File object, sets "path" attribute of the instance.

Public Instance Methods

<<( bytes )

Appends bytes to the bytes.

==( bytes )

Returns true if the bytes of each objects are equal.

bytes( length = nil )

Returns bytes with spcified length or whole length if you omit it.

each() {|byte| ...}

Executes the block for every byte.

length()

Returns length of the bytes.

to_s()

Returns the object as a string.

write_to_file( filename, lock = true )

Writes the bytes to a specified file.