Class: Transpec::Syntax::MethodStub::DeprecatedMethodRecordBuilder
- Inherits:
-
RecordBuilder
- Object
- RecordBuilder
- Transpec::Syntax::MethodStub::DeprecatedMethodRecordBuilder
- Defined in:
- lib/transpec/syntax/method_stub.rb
Instance Attribute Summary collapse
-
#method_stub ⇒ Object
readonly
Returns the value of attribute method_stub.
Instance Method Summary collapse
-
#initialize(method_stub) ⇒ DeprecatedMethodRecordBuilder
constructor
A new instance of DeprecatedMethodRecordBuilder.
- #new_syntax ⇒ Object
- #old_syntax ⇒ Object
Methods inherited from RecordBuilder
Constructor Details
#initialize(method_stub) ⇒ DeprecatedMethodRecordBuilder
Returns a new instance of DeprecatedMethodRecordBuilder.
213 214 215 |
# File 'lib/transpec/syntax/method_stub.rb', line 213 def initialize(method_stub) @method_stub = method_stub end |
Instance Attribute Details
#method_stub ⇒ Object (readonly)
Returns the value of attribute method_stub.
211 212 213 |
# File 'lib/transpec/syntax/method_stub.rb', line 211 def method_stub @method_stub end |
Instance Method Details
#new_syntax ⇒ Object
222 223 224 225 226 |
# File 'lib/transpec/syntax/method_stub.rb', line 222 def new_syntax syntax = 'obj.' syntax << method_stub.replacement_for_deprecated_method syntax << '(:message)' end |
#old_syntax ⇒ Object
217 218 219 220 |
# File 'lib/transpec/syntax/method_stub.rb', line 217 def old_syntax syntax = method_stub.any_instance? ? 'Klass.any_instance' : 'obj' syntax << ".#{method_stub.method_name}(:message)" end |