Class: Spider::Model::Storage::Db::FieldFunction
- Defined in:
- lib/spiderfw/model/storage/db/db_schema.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
Returns the value of attribute as.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#joins ⇒ Object
readonly
Returns the value of attribute joins.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #aggregate=(val) ⇒ Object
- #aggregate? ⇒ Boolean
-
#initialize(expression, table, joins) ⇒ FieldFunction
constructor
A new instance of FieldFunction.
- #to_s ⇒ Object
Constructor Details
#initialize(expression, table, joins) ⇒ FieldFunction
Returns a new instance of FieldFunction.
299 300 301 302 303 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 299 def initialize(expression, table, joins) @expression = expression @table = table @joins = joins end |
Instance Attribute Details
#as ⇒ Object
Returns the value of attribute as.
298 299 300 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 298 def as @as end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
297 298 299 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 297 def expression @expression end |
#joins ⇒ Object (readonly)
Returns the value of attribute joins.
297 298 299 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 297 def joins @joins end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
297 298 299 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 297 def table @table end |
Instance Method Details
#aggregate=(val) ⇒ Object
305 306 307 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 305 def aggregate=(val) @aggregate = val end |
#aggregate? ⇒ Boolean
309 310 311 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 309 def aggregate? !!@aggregate end |
#to_s ⇒ Object
313 314 315 316 317 318 319 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 313 def to_s if @as "#{@expression} AS #{@as}" else @expression end end |