Class: ConvenientService::Utils::Array::Merge Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Array::Merge
- Defined in:
- lib/convenient_service/utils/array/merge.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
- #array ⇒ Object readonly private
- #overrides ⇒ Object readonly private
- #raise_on_non_integer_index ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ Array private
- #initialize(array, overrides, raise_on_non_integer_index: true) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(array, overrides, raise_on_non_integer_index: true) ⇒ 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.
36 37 38 39 40 |
# File 'lib/convenient_service/utils/array/merge.rb', line 36 def initialize(array, overrides, raise_on_non_integer_index: true) @array = array @overrides = overrides @raise_on_non_integer_index = raise_on_non_integer_index end |
Instance Attribute Details
#array ⇒ 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.
16 17 18 |
# File 'lib/convenient_service/utils/array/merge.rb', line 16 def array @array end |
#overrides ⇒ 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.
22 23 24 |
# File 'lib/convenient_service/utils/array/merge.rb', line 22 def overrides @overrides end |
#raise_on_non_integer_index ⇒ 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.
28 29 30 |
# File 'lib/convenient_service/utils/array/merge.rb', line 28 def raise_on_non_integer_index @raise_on_non_integer_index end |
Instance Method Details
#call ⇒ Array
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.
46 47 48 49 50 |
# File 'lib/convenient_service/utils/array/merge.rb', line 46 def call ensure_valid_overrides! integer_key_overrides.each_with_object(array.dup) { |(index, value), array| array[index] = value } end |