Class: ActiveRecord::Migration::TimeRecorder
- Inherits:
-
Object
- Object
- ActiveRecord::Migration::TimeRecorder
- Defined in:
- lib/ridgepole/migration_ext.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #add_key(key) ⇒ Object
- #add_value(value) ⇒ Object
-
#initialize ⇒ TimeRecorder
constructor
A new instance of TimeRecorder.
Constructor Details
#initialize ⇒ TimeRecorder
Returns a new instance of TimeRecorder.
41 42 43 |
# File 'lib/ridgepole/migration_ext.rb', line 41 def initialize @result = {} end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
39 40 41 |
# File 'lib/ridgepole/migration_ext.rb', line 39 def result @result end |
Instance Method Details
#add_key(key) ⇒ Object
45 46 47 |
# File 'lib/ridgepole/migration_ext.rb', line 45 def add_key(key) @key = key end |
#add_value(value) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/ridgepole/migration_ext.rb', line 49 def add_value(value) if @key @result[@key] = value end @key = nil end |