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.
119 120 121 |
# File 'lib/sql/statement.rb', line 119 def initialize(table,field) @table,@field=table,field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
123 124 125 |
# File 'lib/sql/statement.rb', line 123 def field @field end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
123 124 125 |
# File 'lib/sql/statement.rb', line 123 def table @table end |
Instance Method Details
#placeheld ⇒ Object
137 |
# File 'lib/sql/statement.rb', line 137 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.
133 134 135 |
# File 'lib/sql/statement.rb', line 133 def to_s to_sqlpart end |
#to_sqlpart ⇒ Object
125 126 127 |
# File 'lib/sql/statement.rb', line 125 def to_sqlpart @table.to_sqlpart+"."+@field.to_sqlpart end |