Module: SQLite3::Record::ClassMethods
- Defined in:
- lib/metric_system/sqlite3_extensions.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
Instance Method Summary collapse
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
10 11 12 |
# File 'lib/metric_system/sqlite3_extensions.rb', line 10 def columns @columns end |
Instance Method Details
#build(*attrs) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/metric_system/sqlite3_extensions.rb', line 29 def build(*attrs) attrs = columns.zip(attrs).map do |key, value| case key when /_at$/ then to_time(value) when /_on$/ then to_date(value) else value end end new *attrs end |