Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/lib/snt/core/services/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def self.inherited(base)
end

# Provide class level call method as convenience over calling new, then call
def self.call(*args, &block)
new(*args, &block).call
def self.call(...)
new(...).call
end

# @params
Expand Down Expand Up @@ -66,14 +66,14 @@ def execute_completion_callbacks
# options [Hash] attributes:
# - ignore_errors [boolean] Do not add other service's errors to this service's errors
def call_service!(service_class, attributes, options = {})
merge_result!(service_class.new(attributes).call, options)
merge_result!(service_class.new(**attributes).call, options)
end

# Call another service by passing the class, its attributes, and options. If other service fails, ignore the errors by default.
# options [Hash] attributes:
# - ignore_errors [boolean] Do not add other service's errors to this service's errors
def call_service(service_class, attributes, options = { ignore_errors: true })
merge_result(service_class.new(attributes).call, options)
merge_result(service_class.new(**attributes).call, options)
end

private
Expand Down
2 changes: 1 addition & 1 deletion snt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.description = 'Stayntouch'
s.homepage = ''

s.required_ruby_version = '>= 2.1.7'
s.required_ruby_version = '>= 3.0.1'

s.files = Dir.glob('{bin,lib}/**/*') + %w(README.md)
s.bindir = 'bin'
Expand Down