Class: Simple::SQL::Connection::Duplicator
- Inherits:
-
Object
- Object
- Simple::SQL::Connection::Duplicator
- Defined in:
- lib/simple/sql/connection/duplicate.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#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(connection, table_name, overrides) ⇒ Duplicator
constructor
A new instance of Duplicator.
Constructor Details
#initialize(connection, table_name, overrides) ⇒ Duplicator
Returns a new instance of Duplicator.
26 27 28 29 30 |
# File 'lib/simple/sql/connection/duplicate.rb', line 26 def initialize(connection, table_name, overrides) @connection = connection @table_name = table_name @custom_overrides = validated_overrides(overrides) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
22 23 24 |
# File 'lib/simple/sql/connection/duplicate.rb', line 22 def connection @connection end |
#custom_overrides ⇒ Object (readonly)
Returns the value of attribute custom_overrides.
24 25 26 |
# File 'lib/simple/sql/connection/duplicate.rb', line 24 def custom_overrides @custom_overrides end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
23 24 25 |
# File 'lib/simple/sql/connection/duplicate.rb', line 23 def table_name @table_name end |
Instance Method Details
#call(ids) ⇒ Object
32 33 34 35 36 |
# File 'lib/simple/sql/connection/duplicate.rb', line 32 def call(ids) connection.all query, ids rescue PG::UndefinedColumn => e raise ArgumentError, e. end |