class Grape::Validations::ParamsScope::Attr

def self.attr_key(declared_param_attr)

def self.attr_key(declared_param_attr)
  return attr_key(declared_param_attr.key) if declared_param_attr.is_a?(self)
  if declared_param_attr.is_a?(Hash)
    declared_param_attr.transform_values { |value| attrs_keys(value) }
  else
    declared_param_attr
  end
end

def self.attrs_keys(declared_params)

@return Array[Symbol, Hash[Symbol => Array]] declared_params with symbol instead of Attr
def self.attrs_keys(declared_params)
  declared_params.map do |declared_param_attr|
    attr_key(declared_param_attr)
  end
end

def initialize(key, scope)

Parameters:
  • scope (Grape::Validations::ParamsScope) -- scope of attr
  • key (Hash, Symbol) -- key of attr
def initialize(key, scope)
  @key = key
  @scope = scope
end