Skip to content

Commit

Permalink
Remove ruby2_keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
flash-gordon committed Jan 4, 2025
1 parent 562394b commit e7d2b51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/dry/system/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ def loadable?
#
# @return [Object] component's class instance
# @api public
def instance(*args)
options[:instance]&.call(self, *args) || loader.call(self, *args)
def instance(*args, **kwargs)
options[:instance]&.call(self, *args, **kwargs) || loader.call(self, *args, **kwargs)
end
ruby2_keywords(:instance) if respond_to?(:ruby2_keywords, true)

# Returns the component's unique key
#
Expand Down
7 changes: 3 additions & 4 deletions lib/dry/system/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ def require!(component)
# @return [Object]
#
# @api public
def call(component, *args)
def call(component, *args, **kwargs)
require!(component)

constant = self.constant(component)

if singleton?(constant)
constant.instance(*args)
constant.instance(*args, **kwargs)
else
constant.new(*args)
constant.new(*args, **kwargs)
end
end
ruby2_keywords(:call) if respond_to?(:ruby2_keywords, true)

# Returns the component's class constant
#
Expand Down

0 comments on commit e7d2b51

Please sign in to comment.