Class: Transpec::Syntax::MethodStub::DeprecatedMethodRecord
- Defined in:
- lib/transpec/syntax/method_stub.rb
Instance Method Summary collapse
- #converted_syntax ⇒ Object
-
#initialize(method_stub) ⇒ DeprecatedMethodRecord
constructor
A new instance of DeprecatedMethodRecord.
- #original_syntax ⇒ Object
Methods inherited from Record
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_syntax ⇒ Object
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_syntax ⇒ Object
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 |