Sha256: 2ae100118d1a12754997ac2e8db943519a0e08d905608569c275bf0d677553b2

Contents?: true

Size: 675 Bytes

Versions: 21

Compression:

Stored size: 675 Bytes

Contents

module Resourcelogic
  class FailableActionOptions
    extend Resourcelogic::Accessors
    
    scoping_reader :success, :fails
    alias_method :failure, :fails
    
    block_accessor :before
    
    def initialize
      @success = ActionOptions.new
      @fails   = ActionOptions.new
    end
    
    delegate :flash, :flash_now, :after, :response, :wants, :to => :success
    
    def dup
      returning self.class.new do |duplicate|
        duplicate.instance_variable_set(:@success, success.dup)
        duplicate.instance_variable_set(:@fails,   fails.dup)
        duplicate.instance_variable_set(:@before,  before.dup) unless before.nil?
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
binarylogic-resourcelogic-0.0.11 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.0.12 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.0 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.1 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.2 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.3 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.4 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.5 lib/resourcelogic/failable_action_options.rb
binarylogic-resourcelogic-0.12.6 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.6 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.5 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.3 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.4 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.0.11 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.0.12 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.0 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.1 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.12.2 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.11.0 lib/resourcelogic/failable_action_options.rb
resourcelogic-0.10.0 lib/resourcelogic/failable_action_options.rb