Class: ConvenientService::Utils::Method::LooseCall::Signature Private
- Inherits:
-
Object
- Object
- ConvenientService::Utils::Method::LooseCall::Signature
- Defined in:
- lib/convenient_service/utils/method/loose_call.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.
Instance Attribute Summary collapse
- #parameters ⇒ Object readonly private
Instance Method Summary collapse
- #args ⇒ Array<Symbol> private
- #args_rest? ⇒ Boolean private
- #block? ⇒ Boolean private
- #initialize(parameters) ⇒ void constructor private
- #kwargs ⇒ Hash{Symbol => Object} private
- #kwargs_names ⇒ Symbol private
- #kwargs_rest? ⇒ Boolean private
- #loose_args_from(regular_args) ⇒ Array<Object> private
- #loose_block_from(regular_block) ⇒ Proc? private
- #loose_kwargs_from(regular_kwargs) ⇒ Hash{Symbol => Object} private
Constructor Details
#initialize(parameters) ⇒ void
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.
176 177 178 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 176 def initialize(parameters) @parameters = parameters end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
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.
170 171 172 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 170 def parameters @parameters end |
Instance Method Details
#args ⇒ Array<Symbol>
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.
183 184 185 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 183 def args parsed_parameters[:args].to_a end |
#args_rest? ⇒ Boolean
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.
204 205 206 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 204 def args_rest? parsed_parameters.has_key?(:args_rest) end |
#block? ⇒ Boolean
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.
218 219 220 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 218 def block? parsed_parameters.has_key?(:block) end |
#kwargs ⇒ Hash{Symbol => Object}
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.
190 191 192 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 190 def kwargs parsed_parameters[:kwargs].to_a end |
#kwargs_names ⇒ Symbol
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.
197 198 199 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 197 def kwargs_names @kwargs_names ||= kwargs.map { |_, name| name } end |
#kwargs_rest? ⇒ Boolean
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.
211 212 213 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 211 def kwargs_rest? parsed_parameters.has_key?(:kwargs_rest) end |
#loose_args_from(regular_args) ⇒ Array<Object>
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.
226 227 228 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 226 def loose_args_from(regular_args) args_rest? ? regular_args : regular_args.take(args.size) end |
#loose_block_from(regular_block) ⇒ Proc?
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.
242 243 244 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 242 def loose_block_from(regular_block) block? ? regular_block : nil end |
#loose_kwargs_from(regular_kwargs) ⇒ Hash{Symbol => Object}
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.
234 235 236 |
# File 'lib/convenient_service/utils/method/loose_call.rb', line 234 def loose_kwargs_from(regular_kwargs) kwargs_rest? ? regular_kwargs : regular_kwargs.slice(*kwargs_names) end |