Class: RescueFromDuplicate::Rescuer

Inherits:
Object
  • Object
show all
Defined in:
lib/rescue_from_duplicate/rescuer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, options) ⇒ Rescuer

Returns a new instance of Rescuer.



5
6
7
8
9
# File 'lib/rescue_from_duplicate/rescuer.rb', line 5

def initialize(attribute, options)
  @attributes = [attribute]
  @columns = [attribute, *Array(options[:scope])].map(&:to_s).sort
  @options = options
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/rescue_from_duplicate/rescuer.rb', line 3

def attributes
  @attributes
end

#columnsObject (readonly)

Returns the value of attribute columns.



3
4
5
# File 'lib/rescue_from_duplicate/rescuer.rb', line 3

def columns
  @columns
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/rescue_from_duplicate/rescuer.rb', line 3

def options
  @options
end

Instance Method Details

#rescue?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rescue_from_duplicate/rescuer.rb', line 11

def rescue?
  true
end