Class: ConvenientService::Utils::Array::DropWhile Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Array::DropWhile
- Defined in:
- lib/convenient_service/utils/array/drop_while.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
- #condition_block ⇒ Object readonly private
- #inclusively ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ Array private
- #initialize(array, inclusively: false, &condition_block) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(array, inclusively: false, &condition_block) ⇒ 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/drop_while.rb', line 36 def initialize(array, inclusively: false, &condition_block) @array = array @inclusively = inclusively @condition_block = condition_block 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/drop_while.rb', line 16 def array @array end |
#condition_block ⇒ 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/drop_while.rb', line 28 def condition_block @condition_block end |
#inclusively ⇒ 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/drop_while.rb', line 22 def inclusively @inclusively 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.
45 46 47 48 49 50 51 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 45 def call remained_items = array.drop_while(&condition_block) remained_items = remained_items.drop(1) if inclusively remained_items end |