Class: SQL::Composer::Statement
- Inherits:
-
Object
- Object
- SQL::Composer::Statement
- Includes:
- Enumerable
- Defined in:
- lib/sql/composer/statement.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #compiler ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(options) ⇒ Statement
constructor
A new instance of Statement.
- #nodes ⇒ Object
- #set(values) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Statement
Returns a new instance of Statement.
10 11 12 |
# File 'lib/sql/composer/statement.rb', line 10 def initialize() = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/sql/composer/statement.rb', line 8 def end |
Instance Method Details
#compiler ⇒ Object
32 33 34 |
# File 'lib/sql/composer/statement.rb', line 32 def compiler .fetch(:compiler) end |
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/sql/composer/statement.rb', line 14 def each(&block) nodes.each(&block) end |
#nodes ⇒ Object
36 37 38 |
# File 'lib/sql/composer/statement.rb', line 36 def nodes compiler.nodes end |
#set(values) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/sql/composer/statement.rb', line 18 def set(values) tokens = compiler.tokens.new values.each do |key, value| tokens.set(key, value) end compiler.with(tokens: tokens) end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/sql/composer/statement.rb', line 28 def to_s compiler.to_s end |