= Ruby-EET -- Ruby bindings for EET

Ruby-EET allows you to read and write EET[http://enlightenment.org] files
from Ruby code.
Support for Ruby object serialization to EDD (EET Data Descriptor) format
is given.

Ruby-EET is maintained by:

:include: AUTHORS

== License

Ruby-EET is available under an MIT-style license.

:include: COPYING

== Download

The latest version of Ruby-EET can be found at
http://code-monkey.de/pages/ruby-eet

Online documentation is available at
http://docs.code-monkey.de/ruby-eet

== Dependencies

Ruby-EET depends on Rake[http://rake.rubyforge.org] 0.5.0 or greater
and EET[http://www.enlightenment.org].

== Installation

Run "rake install" to install Ruby-EET.

== Usage

=== Basics

Each entry in an EET file consists of an unique key and the data that's
associated with that key.

First, you have to open an EET file by calling Eet::File.open.

Now, you can store arbitrary data in the EET file with Eet::File#write.
To read the data from the EET file, use Eet::File#read.

If you want to store/retrieve image data, see Eet::File#read_image and
Eet::File#write_image.

=== Serializing objects

Ruby-EET also supports the serialization of objects which uses the same
format as the C API uses for its EET data descriptors.
At the time of this writing, deserialization, i.e. read support, isn't
implemented yet, though.

Example:

  class Foo
    def initialize
      @str = "bar"
      @int = 1024
    end
  end

Now, Foo.new.to_eet will serialize the object into EET format.
All of the objects instance variables will be serialized, and the class
name will be used as the tag.

To override the tag, you just need to implement Foo#to_eet_name:

  class Foo
    def to_eet_name
      "Blah"
    end
  end

To control what information is stored for an object, override the method
to_eet_properties.

to_eet_properties returns a hash containing keys that are the names of
the stored properties. Each hash value is an array that contains the
value to store at least. Optionally, it can also contain a type specifier
to enforce specific encoding.

==== Type specifiers

For fixnums and bignums, the valid type specifiers are :char, :short,
:long_long which enforce encoding as 1 byte, 2 byte or 8 byte value
respectively. The default is to encode the value as a 4 byte value.

For floats, the valid type specifier is :double, which enforces encoding
as an 8 byte value. The default is to encode the value as a 4 byte value.
