Method: Multimethod::Parameter#type_object

Defined in:
lib/multimethod/parameter.rb

#type_objectObject

Resolves type name



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/multimethod/parameter.rb', line 213

def type_object
  unless @type_object
    case @type
    when String
      @type_object = Table.instance.name_to_object(@type, 
                                                   @signature && @signature.mod, 
                                                   @signature && @signature.file, 
                                                   @signature && @signature.line)
    when Module
      @type_object = @type
    when NilClass
      @type_object = Kernel
    else
      raise("Incorrect parameter type #{@type.inspect}")
    end
  end
  @type_object
end