Class: Transpec::Syntax::MethodStub::DeprecatedMethodRecord
- Defined in:
- lib/transpec/syntax/method_stub.rb
Constant Summary
Constants inherited from Record
Record::OVERRIDE_FORBIDDEN_METHODS
Instance Attribute Summary
Attributes inherited from Record
#annotation, #converted_syntax_type, #original_syntax_type
Instance Method Summary collapse
- #build_converted_syntax ⇒ Object
- #build_original_syntax ⇒ Object
-
#initialize(method_stub) ⇒ DeprecatedMethodRecord
constructor
A new instance of DeprecatedMethodRecord.
Methods inherited from Record
#==, #converted_syntax, #hash, #original_syntax, #to_s
Constructor Details
#initialize(method_stub) ⇒ DeprecatedMethodRecord
Returns a new instance of DeprecatedMethodRecord.
220 221 222 |
# File 'lib/transpec/syntax/method_stub.rb', line 220 def initialize(method_stub, *) @method_stub = method_stub end |
Instance Method Details
#build_converted_syntax ⇒ Object
229 230 231 232 233 |
# File 'lib/transpec/syntax/method_stub.rb', line 229 def build_converted_syntax syntax = 'obj.' syntax << @method_stub.send(:replacement_method_for_deprecated_method) syntax << '(:message)' end |
#build_original_syntax ⇒ Object
224 225 226 227 |
# File 'lib/transpec/syntax/method_stub.rb', line 224 def build_original_syntax syntax = @method_stub.any_instance? ? 'Klass.any_instance' : 'obj' syntax << ".#{@method_stub.method_name}(:message)" end |