Class: Simple::SQL::Duplicator
- Inherits:
-
Object
- Object
- Simple::SQL::Duplicator
- Defined in:
- lib/simple/sql/duplicate.rb
Instance Attribute Summary collapse
-
#custom_overrides ⇒ Object
readonly
Returns the value of attribute custom_overrides.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #call(ids) ⇒ Object
-
#initialize(table_name, overrides) ⇒ Duplicator
constructor
A new instance of Duplicator.
Constructor Details
#initialize(table_name, overrides) ⇒ Duplicator
Returns a new instance of Duplicator.
38 39 40 41 |
# File 'lib/simple/sql/duplicate.rb', line 38 def initialize(table_name, overrides) @table_name = table_name @custom_overrides = validated_overrides(overrides) end |
Instance Attribute Details
#custom_overrides ⇒ Object (readonly)
Returns the value of attribute custom_overrides.
36 37 38 |
# File 'lib/simple/sql/duplicate.rb', line 36 def custom_overrides @custom_overrides end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
36 37 38 |
# File 'lib/simple/sql/duplicate.rb', line 36 def table_name @table_name end |
Instance Method Details
#call(ids) ⇒ Object
43 44 45 46 47 |
# File 'lib/simple/sql/duplicate.rb', line 43 def call(ids) Simple::SQL.all query, ids rescue PG::UndefinedColumn => e raise ArgumentError, e. end |