Class: DocTestFileList

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_list = []) ⇒ DocTestFileList

Returns a new instance of DocTestFileList.



9
10
11
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb', line 9

def initialize(file_list = [])
  @file_list = file_list
end

Instance Attribute Details

#file_listObject

Returns the value of attribute file_list.



7
8
9
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb', line 7

def file_list
  @file_list
end

Instance Method Details

#-(other) ⇒ Hash

Get diff between two file list

Parameters:

Returns:

  • (Hash)

    diff



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb', line 23

def -(other)
  diff_items = []
  @file_list.each do |current_item|
    found = false
    other.file_list.each do |other_item|
      found = true if current_item == other_item
    end
    diff_items << current_item unless found
  end
  diff_items
end

#[](key) ⇒ DocTestSiteFileListEntry

Access file in list like array

Parameters:

  • key (String)

    name of file

Returns:



16
17
18
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb', line 16

def [](key)
  @file_list[key]
end