Class: Yadriggy::InstanceType

Inherits:
Type
  • Object
show all
Defined in:
lib/yadriggy/type.rb

Overview

Type of a particular Ruby object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#!=, #copy, #eql?, error_found!, #has_role?, role

Constructor Details

#initialize(obj) ⇒ InstanceType

Returns a new instance of InstanceType.



416
417
418
# File 'lib/yadriggy/type.rb', line 416

def initialize(obj)
  @object = obj
end

Instance Attribute Details

#objectObject (readonly)

Returns the Ruby object.

Returns:

  • (Object)

    the Ruby object.



414
415
416
# File 'lib/yadriggy/type.rb', line 414

def object
  @object
end

Instance Method Details

#nameString

Obtains the name of this type.

Returns:

  • (String)

    the type name.



465
466
467
# File 'lib/yadriggy/type.rb', line 465

def name
  @object.to_s
end

#supertypeRubyClass

Returns the RubyClass for this class.

Returns:



459
460
461
# File 'lib/yadriggy/type.rb', line 459

def supertype
  RubyClass[exact_type]
end