Module: Solid::Output::CallableAndThen::Caller::KeyArgs

Defined in:
lib/solid/output/callable_and_then.rb

Class Method Summary collapse

Class Method Details

.invalid_arity(source, method) ⇒ Object



13
14
15
# File 'lib/solid/output/callable_and_then.rb', line 13

def self.invalid_arity(source, method)
  Result::CallableAndThen::Error::InvalidArity.build(source: source, method: method, arity: 'only keyword args')
end

.parameters?(source) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/solid/output/callable_and_then.rb', line 7

def self.parameters?(source)
  parameters = source.parameters.map(&:first)

  !parameters.empty? && parameters.all?(/\Akey/)
end