Class: MysqlFramework::SqlCondition
- Inherits:
-
Object
- Object
- MysqlFramework::SqlCondition
- Defined in:
- lib/mysql_framework/sql_condition.rb
Overview
This class is used to represent a Sql Condition for a column.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
This method is called to get the value of this condition for prepared statements.
Instance Method Summary collapse
-
#initialize(column:, comparison:, value:) ⇒ SqlCondition
constructor
A new instance of SqlCondition.
-
#to_s ⇒ Object
This method is called to get the condition as a string for a sql prepared statement.
Constructor Details
#initialize(column:, comparison:, value:) ⇒ SqlCondition
Returns a new instance of SqlCondition.
9 10 11 12 13 |
# File 'lib/mysql_framework/sql_condition.rb', line 9 def initialize(column:, comparison:, value:) @column = column @comparison = comparison @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
This method is called to get the value of this condition for prepared statements.
7 8 9 |
# File 'lib/mysql_framework/sql_condition.rb', line 7 def value @value end |
Instance Method Details
#to_s ⇒ Object
This method is called to get the condition as a string for a sql prepared statement
16 17 18 |
# File 'lib/mysql_framework/sql_condition.rb', line 16 def to_s "#{@column} #{@comparison} ?" end |