Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Name
- Defined in:
- activerecord/lib/active_record/connection_adapters/postgresql/utils.rb
Overview
Value Object to hold a schema qualified name. This is usually the name of a PostgreSQL relation but it can also represent schema qualified type names. schema
and identifier
are unquoted to prevent double quoting.
Constant Summary collapse
- SEPARATOR =
"."
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #==(o) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(schema, identifier) ⇒ Name
constructor
A new instance of Name.
- #quoted ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(schema, identifier) ⇒ Name
Returns a new instance of Name.
14 15 16 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 14 def initialize(schema, identifier) @schema, @identifier = Utils.unquote_identifier(schema), Utils.unquote_identifier(identifier) end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier
12 13 14 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 12 def identifier @identifier end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema
12 13 14 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 12 def schema @schema end |
Instance Method Details
#==(o) ⇒ Object Also known as: eql?
30 31 32 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 30 def ==(o) o.class == self.class && o.parts == parts end |
#hash ⇒ Object
35 36 37 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 35 def hash parts.hash end |