Class: Spider::Model::Storage::Db::FieldInAliasedTable

Inherits:
Field
  • Object
show all
Defined in:
lib/spiderfw/model/storage/db/db_schema.rb

Instance Attribute Summary

Attributes inherited from Field

#attributes, #name, #table, #type

Instance Method Summary collapse

Methods inherited from Field

#==, #eql?, #hash, #primary_key, #primary_key=

Constructor Details

#initialize(field, table_alias) ⇒ FieldInAliasedTable

Returns a new instance of FieldInAliasedTable.



254
255
256
257
258
259
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 254

def initialize(field, table_alias)
    @table = field.table
    @name = field.name
    @type = field.type
    @table_alias = table_alias
end

Instance Method Details

#inspectObject



265
266
267
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 265

def inspect
    "#<#{self.class.name}:#{self.object_id} @name=\"#{@name}\", @table=#<Spider::Model::Storage::Db::Table:#{@table.object_id} #{@table.name} AS #{@table_alias}> >"
end

#to_sObject



261
262
263
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 261

def to_s
    "#{@table_alias}.#{@name}"
end