Class: Steep::Errors::MethodDefinitionMissing

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#node

Instance Method Summary collapse

Methods inherited from Base

#location_to_str, #print_to

Constructor Details

#initialize(node:, module_name:, kind:, missing_method:) ⇒ MethodDefinitionMissing

Returns a new instance of MethodDefinitionMissing.



341
342
343
344
345
346
# File 'lib/steep/errors.rb', line 341

def initialize(node:, module_name:, kind:, missing_method:)
  super(node: node)
  @module_name = module_name
  @kind = kind
  @missing_method = missing_method
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



338
339
340
# File 'lib/steep/errors.rb', line 338

def kind
  @kind
end

#missing_methodObject (readonly)

Returns the value of attribute missing_method.



339
340
341
# File 'lib/steep/errors.rb', line 339

def missing_method
  @missing_method
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



337
338
339
# File 'lib/steep/errors.rb', line 337

def module_name
  @module_name
end

Instance Method Details

#to_sObject



348
349
350
351
352
353
354
355
356
# File 'lib/steep/errors.rb', line 348

def to_s
  method = case kind
           when :instance
             "#{missing_method}"
           when :module
             "self.#{missing_method}"
           end
  "#{location_to_str}: MethodDefinitionMissing: module=#{module_name}, method=#{method}"
end