Sha256: 269d5d159ef584fe77c6660f29acd764cd98b37f6aacbf84c0ca545139607b64

Contents?: true

Size: 440 Bytes

Versions: 4

Compression:

Stored size: 440 Bytes

Contents

module ChronoModel
  module Patches

    # Added to classes that need to carry the As-Of date around
    #
    module AsOfTimeHolder
      # Sets the virtual 'as_of_time' attribute to the given time, converting to UTC.
      #
      def as_of_time!(time)
        @_as_of_time = time.utc

        self
      end

      # Reads the virtual 'as_of_time' attribute
      #
      def as_of_time
        @_as_of_time
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chrono_model-1.2.2 lib/chrono_model/patches/as_of_time_holder.rb
chrono_model-1.2.1 lib/chrono_model/patches/as_of_time_holder.rb
chrono_model-1.2.0 lib/chrono_model/patches/as_of_time_holder.rb
chrono_model-1.1.0 lib/chrono_model/patches/as_of_time_holder.rb