class RBS::AST::Declarations::Constant

属性

comment[R]
location[R]
name[R]
type[R]

公共类方法

new(name:, type:, location:, comment:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/declarations.rb, line 353
def initialize(name:, type:, location:, comment:)
  @name = name
  @type = type
  @location = location
  @comment = comment
end

公共实例方法

==(other) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/declarations.rb, line 360
def ==(other)
  other.is_a?(Constant) &&
    other.name == name &&
    other.type == type
end
别名: eql?
eql?(other)
== 的别名
hash() 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/declarations.rb, line 368
def hash
  self.class.hash ^ name.hash ^ type.hash
end
to_json(state = _ = nil) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/declarations.rb, line 372
def to_json(state = _ = nil)
  {
    declaration: :constant,
    name: name,
    type: type,
    location: location,
    comment: comment
  }.to_json(state)
end