Class: Hyperion::Sql::SqlQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/hyperion/sql/sql_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_valuesObject (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_strObject (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