class Yadriggy::NonRubyType

@api private

Public Class Methods

new(obj_name, type_name) click to toggle source
# File lib/yadriggy/type.rb, line 116
def initialize(obj_name, type_name)
  @obj_name = obj_name
  @type_name = type_name
end

Public Instance Methods

<=(t) click to toggle source

Check the subtype relation. @param [Type] t the other type. @return [Boolean] true if `self` is equivalent to `t`.

# File lib/yadriggy/type.rb, line 138
def <= (t)
  self == t || t.is_super_of?(self)
end
==(t) click to toggle source

Checks the equality. @param [Type] t the other type. @return [Boolean] true if `self` and `t` represent the same type.

# File lib/yadriggy/type.rb, line 130
def == (t)
  r = NonRubyType.role(t)
  self.equal?(r)
end
inspect() click to toggle source
# File lib/yadriggy/type.rb, line 147
def inspect()
  @obj_name
end
name() click to toggle source

Obtains the name of this type. @return [String] the type name.

# File lib/yadriggy/type.rb, line 123
def name
  @type_name
end
role(t) click to toggle source
# File lib/yadriggy/type.rb, line 142
def role(t)
  r = NonRubyType.role(t)
  self.equal?(r) ? self : nil
end