Class: Ponytail::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/ponytail/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Table

Returns a new instance of Table.



10
11
12
# File 'lib/ponytail/schema.rb', line 10

def initialize(name=nil)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/ponytail/schema.rb', line 9

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/ponytail/schema.rb', line 18

def ==(other)
  name == other.name
end

#columnsObject



14
15
16
# File 'lib/ponytail/schema.rb', line 14

def columns
  @columns ||= ActiveRecord::Base.connection.columns(name)
end