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.
42 43 44 |
# File 'lib/ridgepole/migration_ext.rb', line 42 def initialize @result = {} end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
40 41 42 |
# File 'lib/ridgepole/migration_ext.rb', line 40 def result @result end |
Instance Method Details
#add_key(key) ⇒ Object
46 47 48 |
# File 'lib/ridgepole/migration_ext.rb', line 46 def add_key(key) @key = key end |
#add_value(value) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/ridgepole/migration_ext.rb', line 50 def add_value(value) if @key @result[@key] = value end @key = nil end |