Class: Sinclair::MethodDefinition::ParameterBuilder Private
- Defined in:
- lib/sinclair/method_definition/parameter_builder.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.
Builder a string of parameters
This is used when creating the string for a method defined using a string definition
Class Method Summary collapse
-
.from(parameters, named_parameters) ⇒ String
private
Builds a string representing method parameters.
Instance Method Summary collapse
-
#initialize(parameters, named_parameters) ⇒ ParameterBuilder
constructor
private
A new instance of ParameterBuilder.
-
#to_s ⇒ String
private
Returns the parameters string.
Constructor Details
#initialize(parameters, named_parameters) ⇒ ParameterBuilder
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 ParameterBuilder.
34 35 36 37 |
# File 'lib/sinclair/method_definition/parameter_builder.rb', line 34 def initialize(parameters, named_parameters) @parameters = parameters @named_parameters = named_parameters end |
Class Method Details
.from(parameters, named_parameters) ⇒ 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.
Builds a string representing method parameters
26 27 28 |
# File 'lib/sinclair/method_definition/parameter_builder.rb', line 26 def self.from(*args) new(*args).to_s end |
Instance Method Details
#to_s ⇒ 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.
Returns the parameters string
42 43 44 45 46 |
# File 'lib/sinclair/method_definition/parameter_builder.rb', line 42 def to_s return '' if empty_parameters? "(#{parameters_string})" end |