Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Name
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
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 ::ActiveRecord::ConnectionAdapters::PostgreSQL
relation but it can also represent schema qualified type names. #schema and #identifier are unquoted to prevent double quoting.
Constant Summary
Class Method Summary
- .new(schema, identifier) ⇒ Name constructor
Instance Attribute Summary
- #identifier readonly
- #schema readonly
Instance Method Summary
Constructor Details
.new(schema, identifier) ⇒ Name
# 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 (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 12
attr_reader :schema, :identifier
#schema (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 12
attr_reader :schema, :identifier
Instance Method Details
#==(o) Also known as: #eql?
[ GitHub ]#eql?(o)
Alias for #==.
# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 33
alias_method :eql?, :==
#hash
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 35
def hash parts.hash end
#parts (protected)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 40
def parts @parts ||= [@schema, @identifier].compact end
#quoted
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb', line 22
def quoted if schema PG::Connection.quote_ident(schema) << SEPARATOR << PG::Connection.quote_ident(identifier) else PG::Connection.quote_ident(identifier) end end