Class: Sinclair::MethodDefinition::ParameterHelper Private
- Defined in:
- lib/sinclair/method_definition/parameter_helper.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.
Helper containing helepr methods for remapping parameters
Class Method Summary collapse
-
.parameters_from(parameters_list, named: false) ⇒ String
private
Returns a list of strings of parameters.
Instance Method Summary collapse
-
#initialize(parameters_list, named: nil) ⇒ ParameterHelper
constructor
private
A new instance of ParameterHelper.
-
#strings ⇒ Array<String>
private
All parameters converted into strings.
Constructor Details
#initialize(parameters_list, named: nil) ⇒ ParameterHelper
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 ParameterHelper.
29 30 31 32 |
# File 'lib/sinclair/method_definition/parameter_helper.rb', line 29 def initialize(parameters_list, named: nil) @parameters_list = parameters_list @named = named end |
Class Method Details
.parameters_from(parameters_list, named: false) ⇒ 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 a list of strings of parameters
20 21 22 |
# File 'lib/sinclair/method_definition/parameter_helper.rb', line 20 def self.parameters_from(*args, **opts) new(*args, **opts).strings end |
Instance Method Details
#strings ⇒ Array<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.
All parameters converted into strings
The strings are ready to be pushed into a method definition and joined by ,
40 41 42 43 44 |
# File 'lib/sinclair/method_definition/parameter_helper.rb', line 40 def strings return [] unless parameters_list parameters_strings + defaults_strings + wild_card_parameters end |