Class: KatakataIrb::Types::SingletonType

Inherits:
Object
  • Object
show all
Defined in:
lib/katakata_irb/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_or_class) ⇒ SingletonType

Returns a new instance of SingletonType.



175
176
177
# File 'lib/katakata_irb/types.rb', line 175

def initialize(module_or_class)
  @module_or_class = module_or_class
end

Instance Attribute Details

#module_or_classObject (readonly)

Returns the value of attribute module_or_class.



174
175
176
# File 'lib/katakata_irb/types.rb', line 174

def module_or_class
  @module_or_class
end

Instance Method Details

#all_methodsObject



180
# File 'lib/katakata_irb/types.rb', line 180

def all_methods() = methods | Kernel.methods

#constantsObject



181
# File 'lib/katakata_irb/types.rb', line 181

def constants() = @module_or_class.constants

#inspectObject



185
186
187
# File 'lib/katakata_irb/types.rb', line 185

def inspect
  "#{module_or_class}.itself"
end

#methodsObject



179
# File 'lib/katakata_irb/types.rb', line 179

def methods() = @module_or_class.methods

#nillable?Boolean

Returns:

  • (Boolean)


183
# File 'lib/katakata_irb/types.rb', line 183

def nillable?() = false

#nonnillableObject



184
# File 'lib/katakata_irb/types.rb', line 184

def nonnillable() = self

#transform {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



178
# File 'lib/katakata_irb/types.rb', line 178

def transform() = yield(self)

#typesObject



182
# File 'lib/katakata_irb/types.rb', line 182

def types() = [self]