Sha256: a7efc6f2befeab2d6f296cb217718572e7574ebc894d35df9cf72a6804c7c44d

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

# encoding: utf-8

module IceNine
  class Freezer

    # A freezer class for handling Range objects
    class Range < Object

      # Deep Freeze a Range
      #
      # @example
      #   range = IceNine:Freezer::Range.deep_freeze('a'..'z')
      #   range.begin.frozen?  # => true
      #   range.end.frozen?    # => true
      #
      # @param [Range] range
      #
      # @return [Range]
      #
      # @api public
      def self.deep_freeze(range)
        IceNine.deep_freeze(range.begin)
        IceNine.deep_freeze(range.end)
        super
      end

    end # class Range
  end # class Freezer
end # module IceNine

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ice_nine-0.9.0 lib/ice_nine/freezer/range.rb
ice_nine-0.8.0 lib/ice_nine/freezer/range.rb
ice_nine-0.7.0 lib/ice_nine/freezer/range.rb