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
31 32 33 34 35 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 31 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.
11 12 13 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 11 def array @array end |
#condition_block ⇒ Object (readonly)
Returns the value of attribute condition_block.
23 24 25 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 23 def condition_block @condition_block end |
#inclusively ⇒ Object (readonly)
Returns the value of attribute inclusively.
17 18 19 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 17 def inclusively @inclusively end |
Instance Method Details
#call ⇒ Array
40 41 42 43 44 45 46 |
# File 'lib/convenient_service/utils/array/drop_while.rb', line 40 def call remained_items = array.drop_while(&condition_block) remained_items = remained_items.drop(1) if inclusively remained_items end |