Class: MimeType::T

Inherits:
Struct
  • Object
show all
Defined in:
lib/mimetype.rb

Overview

Note:

this is universal

– Creates a new struct for wrapping out MimeTypes –

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_msgpack_ext(o) ⇒ MimeType::T

Note:

takes a packed array, unpacks to MimeType::T

– –



41
42
43
# File 'lib/mimetype.rb', line 41

def from_msgpack_ext(o)
  new(*MessagePack.unpack(o))
end

Instance Method Details

#to_msgpack_extString

Note:

converts to array then to pack

– Converts MimeType::T to pack –



29
30
31
# File 'lib/mimetype.rb', line 29

def to_msgpack_ext
  to_a.to_msgpack
end