Class: DB::Identifier

Inherits:
Array
  • Object
show all
Defined in:
lib/db/query.rb

Overview

Represents one or more identifiers for databases, tables or columns.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.coerce(name_or_identifier) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/db/query.rb', line 26

def self.coerce(name_or_identifier)
	case name_or_identifier
	when Identifier
		name_or_identifier
	when Array
		self.new(name_or_identifier)
	when Symbol
		self[name_or_identifier]
	else
		self[name_or_identifier.to_sym]
	end
end

Instance Method Details

#append_to(query) ⇒ Object



39
40
41
# File 'lib/db/query.rb', line 39

def append_to(query)
	query.identifier(self)
end