class Nuggets::Hash::ZipMixin::ZipVal

Public Class Methods

new(value) click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 115
def initialize(value)
  @value = zip(value)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 119
def <=>(other)
  to_s <=> other.to_s if self.class.equal?(other.class)
end
==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 136
def eql?(other)
  (self <=> other) == 0
end
Also aliased as: ==
hash() click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 132
def hash
  to_s.hash
end
inspect() click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 127
def inspect
  !((s = to_s).length > 64 || s.include?($/)) ? to_s :
    '#<%s:0x%x length=%p>' % [self.class, object_id, @value.length]
end
to_s() click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 123
def to_s
  unzip(@value)
end

Private Instance Methods

unzip(string) click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 148
def unzip(string)
  Zlib::Inflate.inflate(string)
end
zip(string) click to toggle source
# File lib/nuggets/hash/zip_mixin.rb, line 144
def zip(string)
  Zlib::Deflate.deflate(string)
end