In Files

  • rbs-1.0.4/lib/rbs/types.rb

Class/Module Index [+]

Quicksearch

RBS::Types::Literal

Attributes

literal[R]
location[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 1071
def ==(other)
  other.is_a?(Literal) && other.literal == literal
end
            
Also aliased as: eql?
eql?(other) click to toggle source
Alias for: ==
hash() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 1077
def hash
  self.class.hash ^ literal.hash
end
            
to_json(*a) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 1086
def to_json(*a)
  { class: :literal, literal: literal.inspect, location: location }.to_json(*a)
end
            
to_s(level = 0) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 1090
def to_s(level = 0)
  literal.inspect
end