Class: ConvenientService::Utils::Array::ContainExactly

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/array/contain_exactly.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(first_array, second_array) ⇒ Boolean

Parameters:



43
44
45
46
# File 'lib/convenient_service/utils/array/contain_exactly.rb', line 43

def initialize(first_array, second_array)
  @first_array = first_array
  @second_array = second_array
end

Instance Attribute Details

#first_arrayObject (readonly)

Returns the value of attribute first_array.



30
31
32
# File 'lib/convenient_service/utils/array/contain_exactly.rb', line 30

def first_array
  @first_array
end

#second_arrayObject (readonly)

Returns the value of attribute second_array.



36
37
38
# File 'lib/convenient_service/utils/array/contain_exactly.rb', line 36

def second_array
  @second_array
end

Instance Method Details

#callBoolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/convenient_service/utils/array/contain_exactly.rb', line 51

def call
  first_array.tally == second_array.tally
end