Class: Ronin::Code::SQL::Clause
- Inherits:
-
Object
- Object
- Ronin::Code::SQL::Clause
- Includes:
- Emittable, Fields, Functions, Literals, Statements
- Defined in:
- lib/ronin/code/sql/clause.rb
Overview
Represents a SQL Clause.
Instance Attribute Summary collapse
-
#argument ⇒ Object?
readonly
The clause's argument.
-
#keyword ⇒ Symbol
readonly
The name of the clause.
Instance Method Summary collapse
-
#initialize(keyword, argument = nil) {|(clause)| ... } ⇒ Clause
constructor
Initializes the SQL clause.
Methods included from Emittable
#emitter, #inspect, #to_s, #to_sql
Methods included from Statements
#delete, #drop_table, #insert, #select, #statement, #update
Methods included from Functions
#abs, #acos, #ascii, #asin, #atan, #atan2, #avg, #bin, #bit_and, #bit_count, #bit_length, #bit_or, #ceil, #ceiling, #char, #char_length, #character_length, #concat, #concat_ws, #conv, #cos, #cot, #count, #degrees, #elt, #exp, #export_set, #field, #find_in_set, #floor, #format, #glob, #greatest, #hex, #insert, #instr, #interval, #lcase, #least, #left, #length, #like, #load_file, #locate, #log, #log10, #lower, #lpad, #ltrim, #make_set, #max, #mid, #min, #mod, #oct, #octet_length, #ord, #pi, #position, #pow, #power, #quote, #radians, #rand, #random, #repeat, #replace, #reverse, #right, #round, #rpad, #rtrim, #sign, #sin, #sleep, #soundex, #space, #sqrt, #std, #stddev, #strcmp, #substring, #substring_index, #sum, #tan, #trim, #truncate, #ucase, #unhex, #upper
Methods included from Fields
#method_missing, #respond_to_missing?, #to_ary
Methods included from Literals
Constructor Details
#initialize(keyword, argument = nil) {|(clause)| ... } ⇒ Clause
Initializes the SQL clause.
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/ronin/code/sql/clause.rb', line 70 def initialize(keyword,argument=nil,&block) @keyword = keyword @argument = argument if block @argument = case block.arity when 0 then instance_eval(&block) else block.call(self) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ronin::Code::SQL::Fields
Instance Attribute Details
#argument ⇒ Object? (readonly)
The clause's argument.
52 53 54 |
# File 'lib/ronin/code/sql/clause.rb', line 52 def argument @argument end |
#keyword ⇒ Symbol (readonly)
The name of the clause.
47 48 49 |
# File 'lib/ronin/code/sql/clause.rb', line 47 def keyword @keyword end |