Class: SqlQueryExecutor::Query::Sentence
- Inherits:
-
Object
- Object
- SqlQueryExecutor::Query::Sentence
- Defined in:
- lib/sql_query_executor/query/sentence.rb
Constant Summary collapse
- OPERATORS =
{ "between" => SqlQueryExecutor::Operators::Between, "is" => SqlQueryExecutor::Operators::Is, "in" => SqlQueryExecutor::Operators::In, "=" => SqlQueryExecutor::Operators::Default, ">" => SqlQueryExecutor::Operators::Default, "<" => SqlQueryExecutor::Operators::Default, ">=" => SqlQueryExecutor::Operators::Default, "<=" => SqlQueryExecutor::Operators::Default, "<>" => SqlQueryExecutor::Operators::Default, "!=" => SqlQueryExecutor::Operators::Default, "not" => SqlQueryExecutor::Operators::Default, "exists" => SqlQueryExecutor::Operators::Default,#Exists }
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query) ⇒ Sentence
constructor
A new instance of Sentence.
- #logic(is_hash = false) ⇒ Object
- #selector ⇒ Object
Constructor Details
#initialize(query) ⇒ Sentence
Returns a new instance of Sentence.
26 27 28 29 30 31 |
# File 'lib/sql_query_executor/query/sentence.rb', line 26 def initialize(query) @query = query @array = query.split(' ') set_operator end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
9 10 11 |
# File 'lib/sql_query_executor/query/sentence.rb', line 9 def query @query end |
Instance Method Details
#logic(is_hash = false) ⇒ Object
37 38 39 |
# File 'lib/sql_query_executor/query/sentence.rb', line 37 def logic(is_hash=false) @operator.logic(is_hash) end |
#selector ⇒ Object
33 34 35 |
# File 'lib/sql_query_executor/query/sentence.rb', line 33 def selector @operator.selector end |