123456789_123456789_123456789_123456789_123456789_

Class: RBS::DefinitionBuilder::MethodBuilder::Methods::Definition

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • ::Object
Defined in: lib/rbs/definition_builder/method_builder.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Class Method Details

.empty(name:, type:)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 22

def self.empty(name:, type:)
  new(type: type, name: name, originals: [], overloads: [], accessibilities: [])
end

Instance Attribute Details

#accessibilities (rw)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 7

class Definition < Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true)

#name (rw)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 7

class Definition < Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true)

#originals (rw)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 7

class Definition < Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true)

#overloads (rw)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 7

class Definition < Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true)

#type (rw)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 7

class Definition < Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true)

Instance Method Details

#accessibility

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 14

def accessibility
  if original.is_a?(AST::Members::Alias)
    raise "alias member doesn't have accessibility"
  else
    accessibilities[0] or raise
  end
end

#original

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 10

def original
  originals.first
end