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.



354
355
356
357
358
359
# File 'lib/steep/errors.rb', line 354

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.



351
352
353
# File 'lib/steep/errors.rb', line 351

def kind
  @kind
end

#missing_methodObject (readonly)

Returns the value of attribute missing_method.



352
353
354
# File 'lib/steep/errors.rb', line 352

def missing_method
  @missing_method
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



350
351
352
# File 'lib/steep/errors.rb', line 350

def module_name
  @module_name
end

Instance Method Details

#to_sObject



361
362
363
364
365
366
367
368
369
# File 'lib/steep/errors.rb', line 361

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