Class: ActiveRecord::Migration::TimeRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/ridgepole/migration_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTimeRecorder

Returns a new instance of TimeRecorder.



42
43
44
# File 'lib/ridgepole/migration_ext.rb', line 42

def initialize
  @result = {}
end

Instance Attribute Details

#resultObject (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