Class: Esse::ActiveRecord::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/esse/active_record/callbacks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo:, block_result: nil, with: nil, **kwargs) ⇒ Callback

Returns a new instance of Callback.



8
9
10
11
12
13
# File 'lib/esse/active_record/callbacks.rb', line 8

def initialize(repo:, block_result: nil, with: nil, **kwargs)
  @repo = repo
  @with = with
  @options = kwargs
  @block_result = block_result
end

Instance Attribute Details

#block_resultObject (readonly)

Returns the value of attribute block_result.



6
7
8
# File 'lib/esse/active_record/callbacks.rb', line 6

def block_result
  @block_result
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/esse/active_record/callbacks.rb', line 6

def options
  @options
end

#repoObject (readonly)

Returns the value of attribute repo.



6
7
8
# File 'lib/esse/active_record/callbacks.rb', line 6

def repo
  @repo
end

Instance Method Details

#call(model) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/esse/active_record/callbacks.rb', line 15

def call(model)
  raise NotImplementedError, 'You must implement #call method'
end