123456789_123456789_123456789_123456789_123456789_

Class: RBS::Prototype::RB::Context

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Class Method Details

.initial(namespace: Namespace.root)

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 5

def self.initial(namespace: Namespace.root)
  self.new(module_function: false, singleton: false, namespace: namespace)
end

Instance Attribute Details

#module_function (rw)

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 4

Context = Struct.new(:module_function, :singleton, :namespace, keyword_init: true)

#namespace (rw)

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 4

Context = Struct.new(:module_function, :singleton, :namespace, keyword_init: true)

#singleton (rw)

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 4

Context = Struct.new(:module_function, :singleton, :namespace, keyword_init: true)

Instance Method Details

#attribute_kind

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 19

def attribute_kind
  if singleton
    :singleton
  else
    :instance
  end
end

#method_kind

[ GitHub ]

  
# File 'lib/rbs/prototype/rb.rb', line 9

def method_kind
  if singleton
    :singleton
  elsif module_function
    :singleton_instance
  else
    :instance
  end
end