Class: SQL::Composer::Nodes::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/sql/composer/nodes/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Core

Returns a new instance of Core.



15
16
17
18
# File 'lib/sql/composer/nodes/core.rb', line 15

def initialize(options)
  @options = options
  @id = tokens.next_id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/sql/composer/nodes/core.rb', line 11

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options.



13
14
15
# File 'lib/sql/composer/nodes/core.rb', line 13

def options
  @options
end

Instance Method Details

#backendObject



24
25
26
# File 'lib/sql/composer/nodes/core.rb', line 24

def backend
  fetch(:backend)
end

#fetch(name, default = nil) ⇒ Object



20
21
22
# File 'lib/sql/composer/nodes/core.rb', line 20

def fetch(name, default = nil)
  @options.fetch(name, default)
end

#quote(identifier) ⇒ Object



28
29
30
# File 'lib/sql/composer/nodes/core.rb', line 28

def quote(identifier)
  backend.quote(identifier)
end