Module: Sequel::IdentifierMangling::DatasetMethods
- Defined in:
- lib/sequel/extensions/identifier_mangling.rb
Instance Method Summary collapse
-
#identifier_input_method ⇒ Object
The String instance method to call on identifiers before sending them to the database.
-
#identifier_input_method=(v) ⇒ Object
Set the method to call on identifiers going into the database for this dataset.
-
#identifier_output_method ⇒ Object
The String instance method to call on identifiers before sending them to the database.
-
#identifier_output_method=(v) ⇒ Object
Set the method to call on identifiers coming the database for this dataset.
-
#quote_identifiers? ⇒ Boolean
Check with the database to see if identifier quoting is enabled.
-
#with_identifier_input_method(meth) ⇒ Object
Return a modified dataset with identifier_input_method set.
-
#with_identifier_output_method(meth) ⇒ Object
Return a modified dataset with identifier_output_method set.
Instance Method Details
#identifier_input_method ⇒ Object
The String instance method to call on identifiers before sending them to the database.
134 135 136 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 134 def identifier_input_method @opts.fetch(:identifier_input_method, db.identifier_input_method) end |
#identifier_input_method=(v) ⇒ Object
Set the method to call on identifiers going into the database for this dataset
139 140 141 142 143 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 139 def identifier_input_method=(v) raise_if_frozen!(%w"identifier_input_method= with_identifier_input_method") skip_symbol_cache! @opts[:identifier_input_method] = v end |
#identifier_output_method ⇒ Object
The String instance method to call on identifiers before sending them to the database.
147 148 149 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 147 def identifier_output_method @opts.fetch(:identifier_output_method, db.identifier_output_method) end |
#identifier_output_method=(v) ⇒ Object
Set the method to call on identifiers coming the database for this dataset
152 153 154 155 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 152 def identifier_output_method=(v) raise_if_frozen!(%w"identifier_output_method= with_identifier_output_method") @opts[:identifier_output_method] = v end |
#quote_identifiers? ⇒ Boolean
Check with the database to see if identifier quoting is enabled
158 159 160 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 158 def quote_identifiers? @opts.fetch(:quote_identifiers, db.quote_identifiers?) end |
#with_identifier_input_method(meth) ⇒ Object
Return a modified dataset with identifier_input_method set.
163 164 165 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 163 def with_identifier_input_method(meth) clone(:identifier_input_method=>meth, :skip_symbol_cache=>true) end |
#with_identifier_output_method(meth) ⇒ Object
Return a modified dataset with identifier_output_method set.
168 169 170 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 168 def with_identifier_output_method(meth) clone(:identifier_output_method=>meth) end |