In Files

Included Modules

Gibbler::Range

Creates a digest based on: CLASS:EXCLUDE?:FIRST:LAST where EXCLUDE? is a boolean value whether the Range excludes the last value (i.e. 1...100) and FIRST and LAST are the values returned by Range#first and Range#last. e.g.

(1..100)   =>  Range:false:1:100  =>  54506352
(1...100)  =>  Range:true:1:100   =>  f0cad8cc

To use use method in other classes simply:

class ClassLikeRange 
  include Gibbler::Range
end

Public Class Methods

included(obj) click to toggle source
# File lib/gibbler.rb, line 587
def self.included(obj)
  obj.extend Attic
  obj.attic :gibbler_cache
end

Public Instance Methods

__gibbler(digest_type=nil) click to toggle source

Creates a digest for the current state of self.

# File lib/gibbler.rb, line 593
def __gibbler(digest_type=nil)
  klass = self.class
  if self.nil? 
    first, last, exclude = "\00"", "\00"", "\00""
  else
    first, last, exclude = self.first, self.last, self.exclude_end?
  end
  a = Gibbler.digest "%s:%s:%s:%s" % [klass, exclude, first, last], digest_type
  gibbler_debug klass, a, [klass, exclude, first, last]
  a
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.