Class: Transpec::Syntax::MethodStub::DeprecatedMethodRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/transpec/syntax/method_stub.rb

Instance Method Summary collapse

Methods inherited from Record

#==, #hash, #to_s

Constructor Details

#initialize(method_stub) ⇒ DeprecatedMethodRecord

Returns a new instance of DeprecatedMethodRecord.



224
225
226
# File 'lib/transpec/syntax/method_stub.rb', line 224

def initialize(method_stub, *)
  @method_stub = method_stub
end

Instance Method Details

#converted_syntaxObject



233
234
235
236
237
# File 'lib/transpec/syntax/method_stub.rb', line 233

def converted_syntax
  syntax = 'obj.'
  syntax << @method_stub.send(:replacement_method_for_deprecated_method)
  syntax << '(:message)'
end

#original_syntaxObject



228
229
230
231
# File 'lib/transpec/syntax/method_stub.rb', line 228

def original_syntax
  syntax = @method_stub.any_instance? ? 'Klass.any_instance' : 'obj'
  syntax << ".#{@method_stub.method_name}(:message)"
end