Class: Sinclair::MethodDefinition::StringDefinition Private
- Inherits:
-
MethodDefinition
- Object
- MethodDefinition
- Sinclair::MethodDefinition::StringDefinition
- Defined in:
- lib/sinclair/method_definition/string_definition.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Define an instance method from string
Instance Method Summary collapse
-
#code_definition ⇒ String
private
string with the code to be defined.
-
#initialize(name, code = nil, **options) ⇒ StringDefinition
constructor
private
A new instance of StringDefinition.
Constructor Details
#initialize(name, code = nil, **options) ⇒ StringDefinition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StringDefinition.
17 18 19 20 |
# File 'lib/sinclair/method_definition/string_definition.rb', line 17 def initialize(name, code = nil, **) @code = code super(name, **) end |
Instance Method Details
#code_definition ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
string with the code to be defined
28 29 30 31 32 33 34 |
# File 'lib/sinclair/method_definition/string_definition.rb', line 28 def code_definition <<-CODE def #{name}#{parameters_string} #{code_line} end CODE end |