Class: Exwiw::QueryAst::Select
- Inherits:
-
Object
- Object
- Exwiw::QueryAst::Select
- Defined in:
- lib/exwiw/query_ast.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#from_table_name ⇒ Object
readonly
Returns the value of attribute from_table_name.
-
#join_clauses ⇒ Object
readonly
Returns the value of attribute join_clauses.
-
#where_clauses ⇒ Object
readonly
Returns the value of attribute where_clauses.
Instance Method Summary collapse
- #from(table) ⇒ Object
-
#initialize ⇒ Select
constructor
A new instance of Select.
- #join(join_clause) ⇒ Object
- #select(columns) ⇒ Object
- #where(where_clause) ⇒ Object
Constructor Details
#initialize ⇒ Select
48 49 50 51 52 53 |
# File 'lib/exwiw/query_ast.rb', line 48 def initialize @from_table_name = nil @columns = [] @where_clauses = [] @join_clauses = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
46 47 48 |
# File 'lib/exwiw/query_ast.rb', line 46 def columns @columns end |
#from_table_name ⇒ Object (readonly)
Returns the value of attribute from_table_name.
46 47 48 |
# File 'lib/exwiw/query_ast.rb', line 46 def from_table_name @from_table_name end |
#join_clauses ⇒ Object (readonly)
Returns the value of attribute join_clauses.
46 47 48 |
# File 'lib/exwiw/query_ast.rb', line 46 def join_clauses @join_clauses end |
#where_clauses ⇒ Object (readonly)
Returns the value of attribute where_clauses.
46 47 48 |
# File 'lib/exwiw/query_ast.rb', line 46 def where_clauses @where_clauses end |
Instance Method Details
#from(table) ⇒ Object
55 56 57 |
# File 'lib/exwiw/query_ast.rb', line 55 def from(table) @from_table_name = table end |
#join(join_clause) ⇒ Object
67 68 69 |
# File 'lib/exwiw/query_ast.rb', line 67 def join(join_clause) @join_clauses << join_clause end |
#select(columns) ⇒ Object
59 60 61 |
# File 'lib/exwiw/query_ast.rb', line 59 def select(columns) @columns = map_column_value(columns) end |
#where(where_clause) ⇒ Object
63 64 65 |
# File 'lib/exwiw/query_ast.rb', line 63 def where(where_clause) @where_clauses << where_clause end |