#--
-# $Id: eet.rb 49 2005-05-30 19:52:36Z tilman $
-#
-# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
+# Copyright (c) 2005-2007 Tilman Sauerbeck (tilman at code-monkey de)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
end
end
-class Integer # :nodoc:
- def to_eet_chunks(tag, type = nil)
- fmt = case type
- when :char: "c"
- when :short: "v"
- when :long_long: "q"
- else "V"
- end
-
- data = [self].pack(fmt)
- [Eet::Chunk.new(tag, data)]
- end
-end
-
-class Float # :nodoc:
- def to_eet_chunks(tag, type = nil)
- fmt = case type
- when :double: "%32.32f"
- else "%16.16f"
- end
-
- data = fmt % self
- [Eet::Chunk.new(tag, data + "\0")]
- end
-end
-
class String # :nodoc:
def to_eet_chunks(tag, type = nil)
[Eet::Chunk.new(tag, self + "\0")]
end
module Eet
- VERSION = "0.1.2"
+ VERSION = "0.1.4"
class ChunkError < EetError; end