Class: RailsDbInfo::Table
- Inherits:
-
Object
- Object
- RailsDbInfo::Table
- Defined in:
- lib/rails_db_info/table.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #column_properties ⇒ Object
- #columns ⇒ Object
-
#initialize(table_name) ⇒ Table
constructor
A new instance of Table.
- #to_param ⇒ Object
Constructor Details
#initialize(table_name) ⇒ Table
Returns a new instance of Table.
6 7 8 |
# File 'lib/rails_db_info/table.rb', line 6 def initialize(table_name) @name = table_name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rails_db_info/table.rb', line 4 def name @name end |
Instance Method Details
#column_properties ⇒ Object
14 15 16 |
# File 'lib/rails_db_info/table.rb', line 14 def column_properties %w(name sql_type null limit precision scale type default primary coder) end |
#columns ⇒ Object
10 11 12 |
# File 'lib/rails_db_info/table.rb', line 10 def columns connection.columns(name) end |
#to_param ⇒ Object
18 19 20 |
# File 'lib/rails_db_info/table.rb', line 18 def to_param name end |