class Nuggets::Hash::ZipMixin::ZipVal

Public Class Methods

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

Public Instance Methods

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

Private Instance Methods

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