class RBS::Types::Literal

Attributes

literal[R]
location[R]

Public Class Methods

new(literal:, location:) click to toggle source
# File rbs-2.8.2/lib/rbs/types.rb, line 1194
def initialize(literal:, location:)
  @literal = literal
  @location = location
end

Public Instance Methods

==(other) click to toggle source
# File rbs-2.8.2/lib/rbs/types.rb, line 1199
def ==(other)
  other.is_a?(Literal) && other.literal == literal
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File rbs-2.8.2/lib/rbs/types.rb, line 1205
def hash
  self.class.hash ^ literal.hash
end
to_json(state = _ = nil) click to toggle source
# File rbs-2.8.2/lib/rbs/types.rb, line 1214
def to_json(state = _ = nil)
  { class: :literal, literal: literal.inspect, location: location }.to_json(state)
end
to_s(level = 0) click to toggle source
# File rbs-2.8.2/lib/rbs/types.rb, line 1218
def to_s(level = 0)
  literal.inspect
end