Skip to content

Instantly share code, notes, and snippets.

@prahal
Created April 17, 2022 01:41
Show Gist options
  • Save prahal/871af282b59589812eb706ee1e327a16 to your computer and use it in GitHub Desktop.
Save prahal/871af282b59589812eb706ee1e327a16 to your computer and use it in GitHub Desktop.
cannot convert hash to keyword arguments in super - wrong number of arguments error
class Base
attr_reader :gitolite_config, :repository, :context, :options
def initialize(gitolite_config, repository, context, **options)
@gitolite_config = gitolite_config
@repository = repository
@context = context
@options = options.dup
@old_perms = {}
end
class << self
def call(gitolite_config, repository, context, **options)
new(gitolite_config, repository, context, **options).call
end
end
def call
raise NotImplementedError
end
end
class AddRepository < Base
def call
puts 'test'
end
def initialize(*args)
super
@force = options.delete(:force) { false }
@old_perms = options.delete(:old_perms) { {} }
end
end
AddRepository.call "gitolite_config", "repository", "context", **{:a => 'value'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment