Class: Spider::Model::Storage::Db::FieldExpression
- Defined in:
- lib/spiderfw/model/storage/db/db_schema.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Attributes inherited from Field
#attributes, #name, #table, #type
Instance Method Summary collapse
-
#initialize(table, name, type, attributes = {}) ⇒ FieldExpression
constructor
A new instance of FieldExpression.
- #to_s ⇒ Object
Methods inherited from Field
#==, #eql?, #hash, #inspect, #primary_key, #primary_key=
Constructor Details
#initialize(table, name, type, attributes = {}) ⇒ FieldExpression
Returns a new instance of FieldExpression.
274 275 276 277 278 279 280 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 274 def initialize(table, name, type, attributes={}) @table = table @name = name.to_s @type = type @attributes = attributes @expression = attributes[:expression] end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
272 273 274 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 272 def expression @expression end |
Instance Method Details
#to_s ⇒ Object
283 284 285 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 283 def to_s "#{@expression} AS #{@name}" end |