Class: Ronin::SQL::Clause
- Inherits:
-
Struct
- Object
- Struct
- Ronin::SQL::Clause
- Includes:
- Emittable, Fields, Functions, Literals, Statements
- Defined in:
- lib/ronin/sql/clause.rb
Overview
Represents a SQL Clause.
Instance Attribute Summary collapse
-
#argument ⇒ Object
Returns the value of attribute argument.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
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, #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.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ronin/sql/clause.rb', line 61 def initialize(keyword,argument=nil,&block) super(keyword,argument) if block self.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::SQL::Fields
Instance Attribute Details
#argument ⇒ Object
Returns the value of attribute argument
37 38 39 |
# File 'lib/ronin/sql/clause.rb', line 37 def argument @argument end |
#keyword ⇒ Object
Returns the value of attribute keyword
37 38 39 |
# File 'lib/ronin/sql/clause.rb', line 37 def keyword @keyword end |