Class: SQLStatement::SQL_Field
Overview
SQL_Field is used for representing field names qualified by table names. Their text expansion looks like `tablename`.`fieldname`.
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(table, field) ⇒ SQL_Field
constructor
A new instance of SQL_Field.
- #placeheld ⇒ Object
-
#to_s ⇒ Object
This is used when performing #… substitions although technically, it should be made to work like the Symbol.to_s (which gives unquoted results), this works just fine giving quoted results.
- #to_sqlpart ⇒ Object
Constructor Details
#initialize(table, field) ⇒ SQL_Field
Returns a new instance of SQL_Field.
139 140 141 |
# File 'lib/sql/statement.rb', line 139 def initialize(table,field) @table,@field=table,field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
143 144 145 |
# File 'lib/sql/statement.rb', line 143 def field @field end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
143 144 145 |
# File 'lib/sql/statement.rb', line 143 def table @table end |
Instance Method Details
#placeheld ⇒ Object
157 |
# File 'lib/sql/statement.rb', line 157 def placeheld; []; end |
#to_s ⇒ Object
This is used when performing #… substitions although technically, it should be made to work like the Symbol.to_s (which gives unquoted results), this works just fine giving quoted results.
153 154 155 |
# File 'lib/sql/statement.rb', line 153 def to_s to_sqlpart end |
#to_sqlpart ⇒ Object
145 146 147 |
# File 'lib/sql/statement.rb', line 145 def to_sqlpart @table.to_sqlpart+"."+@field.to_sqlpart end |