Class: ResourceController::FailableActionOptions

Inherits:
Object
  • Object
show all
Extended by:
Accessors
Defined in:
lib/resource_controller/failable_action_options.rb

Instance Method Summary collapse

Constructor Details

#initializeFailableActionOptions

Returns a new instance of FailableActionOptions.



10
11
12
13
# File 'lib/resource_controller/failable_action_options.rb', line 10

def initialize
  @success = ActionOptions.new
  @fails   = ActionOptions.new
end

Instance Method Details

#dupObject



17
18
19
20
21
22
23
# File 'lib/resource_controller/failable_action_options.rb', line 17

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