Module: IdentifiesAs::ObjectInstance

Includes:
ActuallyIsA
Included in:
Object
Defined in:
lib/identifies_as/object_instance.rb

Instance Method Summary collapse

Instance Method Details

#__identifies_as__!(*objects) ⇒ Object Also known as: identifies_as!

Cause receiver to identify as specified objects.

Parameters:

  • objects (Array<Object>)

    Other objects self should identify as.

Returns:



13
14
15
16
17
# File 'lib/identifies_as/object_instance.rb', line 13

def __identifies_as__!( *objects )

  return ::IdentifiesAs.object_identifies_as!( self, *objects )
  
end

#__identifies_as__?(object) ⇒ true, false Also known as: identifies_as?

Query whether receiver identifies as specified object.

Parameters:

  • object (Object)

    Object against which identity is being tested.

Returns:

  • (true, false)

    Whether receiver identifies as object.



28
29
30
31
32
# File 'lib/identifies_as/object_instance.rb', line 28

def __identifies_as__?( object )
  
  return ::IdentifiesAs.object_identifies_as?( self, object )    
  
end

#__identities__Array<Object> Also known as: identities

Identities that receiver identifies as, beyond those which it actually is.

Returns:

  • (Array<Object>)

    Identities receiver identifies as.



42
43
44
45
46
# File 'lib/identifies_as/object_instance.rb', line 42

def __identities__
  
  return ::IdentifiesAs.object_identities( self )    
  
end

#__stop_identifying_as__!(*objects) ⇒ Object Also known as: stop_identifying_as!

Cause receiver to no longer identify as specified objects.

Parameters:

  • objects (Array<Object>)

    Other objects receiver should no longer identify as.

Returns:



57
58
59
60
61
# File 'lib/identifies_as/object_instance.rb', line 57

def __stop_identifying_as__!( *objects )
  
  return ::IdentifiesAs.stop_object_identifying_as!( self, *objects )    
  
end

#is_a?(object) ⇒ Boolean Also known as: __is_a__?

is_a? #

Returns:

  • (Boolean)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/identifies_as/object_instance.rb', line 69

def is_a?( object )
  
  is_type = false

  if __actually_is_a__?( ::IdentifiesAs ) and 
     __identifies_as__?( object )    
    is_type = true
  else
    is_type = super
  end
  
  return is_type
  
end