Class: ConvenientService::Utils::Array::DropWhile
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Array::DropWhile
- Defined in:
- lib/convenient_service/utils/array/drop_while.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
-
#condition_block ⇒ Object
readonly
Returns the value of attribute condition_block.
-
#inclusively ⇒ Object
readonly
Returns the value of attribute inclusively.
Instance Method Summary collapse
Methods inherited from Support::Command
Constructor Details
#initialize(array, inclusively: false, &condition_block) ⇒ void
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)
Returns the value of attribute array.
16 17 18 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 16 def array @array end |
#condition_block ⇒ Object (readonly)
Returns the value of attribute condition_block.
28 29 30 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 28 def condition_block @condition_block end |
#inclusively ⇒ Object (readonly)
Returns the value of attribute inclusively.
22 23 24 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 22 def inclusively @inclusively end |
Instance Method Details
#call ⇒ Array
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 |