Sha256: f7d86fd0f43316623063312bc7b02686d2af8a98f5e7b3c00d814d927c591ca1

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 Bytes

Contents

require 'trice/controller_methods/reference_time_assignment'
require 'trice/controller_methods/stub_configuration'

module Trice
  module ControllerMethods

    extend ActiveSupport::Concern

    included do |controller|
      if controller.ancestors.include?(ActionController::Base)
        config = StubConfiguration.new(Trice.support_requested_at_stubbing)
        prepend_around_action ReferenceTimeAssignment.new(config)

        helper_method :requested_at
        hide_action   :requested_at
      end
    end

    def requested_at
      Trice.reference_time
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trice-0.1.1 lib/trice/controller_methods.rb
trice-0.1.0 lib/trice/controller_methods.rb