Class: ROM::SQL::Migration::Recorder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/sql/migration/recorder.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Recorder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Recorder.


10
11
12
13
14
# File 'lib/rom/sql/migration/recorder.rb', line 10

def initialize(&block)
  @operations = []

  instance_exec(&block) if block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


16
17
18
19
# File 'lib/rom/sql/migration/recorder.rb', line 16

def method_missing(m, *args, &block)
  nested = block ? Recorder.new(&block).operations : EMPTY_ARRAY
  @operations << [m, args, nested]
end

Instance Attribute Details

#operationsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


8
9
10
# File 'lib/rom/sql/migration/recorder.rb', line 8

def operations
  @operations
end