Class: RecordFormatter::Model
- Inherits:
-
Object
- Object
- RecordFormatter::Model
- Defined in:
- lib/record_formatter/model.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
Instance Method Summary collapse
- #add_column(name, options = {}) ⇒ Object
-
#initialize ⇒ Model
constructor
A new instance of Model.
Constructor Details
#initialize ⇒ Model
Returns a new instance of Model.
6 7 8 |
# File 'lib/record_formatter/model.rb', line 6 def initialize @columns = [] end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
4 5 6 |
# File 'lib/record_formatter/model.rb', line 4 def columns @columns end |
Instance Method Details
#add_column(name, options = {}) ⇒ Object
10 11 12 13 |
# File 'lib/record_formatter/model.rb', line 10 def add_column name, ={} @columns.delete(name) if columns.include?(name) @columns << add_column_internal(name, ) end |