class RBS::Types::Function::Param

def ==(other)

def ==(other)
  other.is_a?(Param) && other.type == type && other.name == name
end

def hash

def hash
  self.class.hash ^ type.hash ^ name.hash
end

def initialize(type:, name:, location: nil)

def initialize(type:, name:, location: nil)
  @type = type
  @name = name
  @location = location
end

def map_type(&block)

def map_type(&block)
  if block
    Param.new(name: name, type: yield(type), location: location)
  else
    enum_for :map_type
  end
end

def to_json(state = _ = nil)

def to_json(state = _ = nil)
  { type: type, name: name }.to_json(state)
end

def to_s

def to_s
  if name
    if name.match?(/\A[a-zA-Z0-9_]+\z/)
      "#{type} #{name}"
    else
      "#{type} `#{name}`"
    end
  else
    "#{type}"
  end
end