Class: Miteru::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/miteru/service.rb

Overview

Base class for services

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callObject



19
20
21
# File 'lib/miteru/service.rb', line 19

def call(...)
  new.call(...)
end

.resultObject



23
24
25
# File 'lib/miteru/service.rb', line 23

def result(...)
  new.result(...)
end

Instance Method Details

#call(*args, **kwargs) ⇒ Object

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/miteru/service.rb', line 10

def call(*args, **kwargs)
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end

#resultObject



14
15
16
# File 'lib/miteru/service.rb', line 14

def result(...)
  Try[StandardError] { call(...) }.to_result
end