Sha256: f3ea7a098719cd20acfa1971b7e8552364e351ed69a3f32402c749a95265cfd8

Contents?: true

Size: 316 Bytes

Versions: 7

Compression:

Stored size: 316 Bytes

Contents

module Trice
  module ControllerMethods
    class StubConfiguration
      def initialize(condition)
        @condition = condition
        @is_callable = @condition.respond_to?(:call)
      end

      def stubbable?(request)
        @is_callable ? @condition.call(request) : !!@condition
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trice-0.3.2 lib/trice/controller_methods/stub_configuration.rb
trice-0.3.1 lib/trice/controller_methods/stub_configuration.rb
trice-0.3.0 lib/trice/controller_methods/stub_configuration.rb
trice-0.2.1 lib/trice/controller_methods/stub_configuration.rb
trice-0.2.0 lib/trice/controller_methods/stub_configuration.rb
trice-0.1.1 lib/trice/controller_methods/stub_configuration.rb
trice-0.1.0 lib/trice/controller_methods/stub_configuration.rb