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.



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

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.



360
361
362
# File 'lib/steep/errors.rb', line 360

def kind
  @kind
end

#missing_methodObject (readonly)

Returns the value of attribute missing_method.



361
362
363
# File 'lib/steep/errors.rb', line 361

def missing_method
  @missing_method
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



359
360
361
# File 'lib/steep/errors.rb', line 359

def module_name
  @module_name
end

Instance Method Details

#to_sObject



370
371
372
373
374
375
376
377
378
# File 'lib/steep/errors.rb', line 370

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