Class: ServiceObjects::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/service_objects/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(change) ⇒ Base


7
8
9
# File 'lib/service_objects/base.rb', line 7

def initialize(change)
  @change = change
end

Instance Attribute Details

#changeObject (readonly)

Returns the value of attribute change


5
6
7
# File 'lib/service_objects/base.rb', line 5

def change
  @change
end

Class Method Details

.ignore?(change) ⇒ Boolean


21
22
23
# File 'lib/service_objects/base.rb', line 21

def self.ignore?(change)
  self.new(change).ignore?
end

Instance Method Details

#callObject

return value: should be nil if nothing is done or a symbol of action taken

Raises:

  • (NotImplementedError)

12
13
14
# File 'lib/service_objects/base.rb', line 12

def call
  raise NotImplementedError, 'Override this method in child classes'
end

#ignore?Boolean

return value: true/false

Raises:

  • (NotImplementedError)

17
18
19
# File 'lib/service_objects/base.rb', line 17

def ignore?
  raise NotImplementedError, 'Override this method in child classes'
end