class RBS::Types::Function::Param
Attributes
location
[R]
loc?
type
[R]
t
Public Class Methods
(type: t, name: Symbol?, ?location: loc?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 921 def initialize(type:, name:, location: nil) @type = type @name = name @location = location end
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 927 def ==(other) other.is_a?(Param) && other.type == type && other.name == name end
Also aliased as: eql?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 933 def hash self.class.hash ^ type.hash ^ name.hash end
() { (t) → t } → Param
() → Enumerator[t, Param]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 937 def map_type(&block) if block Param.new(name: name, type: yield(type), location: location) else enum_for :map_type end end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 945 def to_json(state = nil) { type: type, name: name }.to_json(state) end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 949 def to_s if name if name.match?(/\A[a-zA-Z0-9_]+\z/) "#{type} #{name}" else "#{type} `#{name}`" end else "#{type}" end end