Skip to content

Commit

Permalink
fix kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Jun 18, 2021
1 parent b660b3b commit 51bc080
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/resol/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def before_call(method_name)
private

def __run_callbacks__(instance)
@__callback_methods__.each { |method_name| instance.send(method_name) }
@__callback_methods__.each { |method_name| instance.__send__(method_name) }
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/resol/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def value!
end
end

def self.Success(*args)
Success.new(*args)
def self.Success(*args, **kwargs)
Success.new(*args, **kwargs)
end

def self.Failure(*args)
Failure.new(*args)
def self.Failure(*args, **kwargs)
Failure.new(*args, **kwargs)
end
end
8 changes: 4 additions & 4 deletions lib/resol/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def inherited(klass)
super
end

def call(*args, &block)
command = build(*args)
def call(*args, **kwargs, &block)
command = build(*args, **kwargs)
__run_callbacks__(command)
command.call(&block)

Expand All @@ -64,8 +64,8 @@ def call(*args, &block)
Resol::Failure(e)
end

def call!(*args)
call(*args).value_or { |error| raise error }
def call!(*args, **kwargs)
call(*args, **kwargs).value_or { |error| raise error }
end
end

Expand Down

0 comments on commit 51bc080

Please sign in to comment.