Module: ControllableVersioning::ClassMethods

Defined in:
lib/controllable_versioning/class_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/controllable_versioning/class_methods.rb', line 3

def self.extended(klass)
  klass.class_eval do
    @default = true
    @user_defined_column_hash = {}
    @excluded_columns = []
  end
end

Instance Method Details

#control_versioningObject



11
12
13
# File 'lib/controllable_versioning/class_methods.rb', line 11

def control_versioning
  yield
end

#target_modelObject



15
16
17
# File 'lib/controllable_versioning/class_methods.rb', line 15

def target_model
  @target_model
end

#versioned_column_hashObject



19
20
21
22
23
24
# File 'lib/controllable_versioning/class_methods.rb', line 19

def versioned_column_hash
  target_hash = {}
  target_hash.merge!(default_column_hash) if @default
  target_hash.merge!(@user_defined_column_hash)
  target_hash
end