Class: Hyperion::Sql::SqlQuery
- Inherits:
-
Object
- Object
- Hyperion::Sql::SqlQuery
- Defined in:
- lib/hyperion/sql/sql_query.rb
Instance Attribute Summary collapse
-
#bind_values ⇒ Object
readonly
Returns the value of attribute bind_values.
-
#query_str ⇒ Object
readonly
Returns the value of attribute query_str.
Instance Method Summary collapse
- #append(str, values = []) ⇒ Object
-
#initialize(query_str, bind_values = []) ⇒ SqlQuery
constructor
A new instance of SqlQuery.
Constructor Details
#initialize(query_str, bind_values = []) ⇒ SqlQuery
Returns a new instance of SqlQuery.
8 9 10 11 |
# File 'lib/hyperion/sql/sql_query.rb', line 8 def initialize(query_str, bind_values=[]) @query_str = query_str @bind_values = bind_values || [] end |
Instance Attribute Details
#bind_values ⇒ Object (readonly)
Returns the value of attribute bind_values.
6 7 8 |
# File 'lib/hyperion/sql/sql_query.rb', line 6 def bind_values @bind_values end |
#query_str ⇒ Object (readonly)
Returns the value of attribute query_str.
6 7 8 |
# File 'lib/hyperion/sql/sql_query.rb', line 6 def query_str @query_str end |
Instance Method Details
#append(str, values = []) ⇒ Object
13 14 15 16 |
# File 'lib/hyperion/sql/sql_query.rb', line 13 def append(str, values=[]) @query_str << " #{str}" @bind_values += values if values end |