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.



418
419
420
# File 'lib/yadriggy/type.rb', line 418

def initialize(obj)
  @object = obj
end

Instance Attribute Details

#objectObject (readonly)

Returns the Ruby object.

Returns:

  • (Object)

    the Ruby object.



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

def object
  @object
end

Instance Method Details

#nameString

Obtains the name of this type.

Returns:

  • (String)

    the type name.



467
468
469
# File 'lib/yadriggy/type.rb', line 467

def name
  @object.to_s
end

#supertypeRubyClass

Returns the RubyClass for this class.

Returns:



461
462
463
# File 'lib/yadriggy/type.rb', line 461

def supertype
  RubyClass[exact_type]
end