Sha256: 8a90828219299b3f0467eb458f2ee23bf168210d1e5a556cdf610fdd64b7d09c

Contents?: true

Size: 685 Bytes

Versions: 67

Compression:

Stored size: 685 Bytes

Contents

module ResourceController
  class FailableActionOptions
    extend ResourceController::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

67 entries across 67 versions & 19 rubygems

Version Path
akitaonrails-resource_controller-0.5.2 lib/resource_controller/failable_action_options.rb
akitaonrails-resource_controller-0.5.3 lib/resource_controller/failable_action_options.rb
csmosx-resource_controller-0.6.6 lib/resource_controller/failable_action_options.rb
csmosx-resource_controller-0.6.7 lib/resource_controller/failable_action_options.rb
dkubb-resource_controller-0.6.5 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.4.10 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.4.12 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.4.9 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.5.1 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.5.2 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.5.3 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.5.5 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.5.6 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.6.0 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.6.1 lib/resource_controller/failable_action_options.rb
giraffesoft-resource_controller-0.6.5 lib/resource_controller/failable_action_options.rb
jeffrafter-resource_controller-0.5.5 lib/resource_controller/failable_action_options.rb
kdmny-spree-0.0.1 vendor/plugins/resource_controller/lib/resource_controller/failable_action_options.rb
korin-resource_controller-0.5.3 lib/resource_controller/failable_action_options.rb
maser-resource_controller-0.6.6 lib/resource_controller/failable_action_options.rb