Class: RSpec::XlsxMatchers::BaseSheet

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/rspec/xlsx_matchers/base_sheet.rb

Overview

Base class for sheet based machers

Direct Known Subclasses

CellValue, Cells, Columns, EmptyRow, FilledRows

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#force_array, #map_output

Instance Attribute Details

#sheetObject (readonly)

Returns the value of attribute sheet.



8
9
10
# File 'lib/rspec/xlsx_matchers/base_sheet.rb', line 8

def sheet
  @sheet
end

#sheet_nameObject (readonly)

Returns the value of attribute sheet_name.



8
9
10
# File 'lib/rspec/xlsx_matchers/base_sheet.rb', line 8

def sheet_name
  @sheet_name
end

#subjectObject (readonly)

Returns the value of attribute subject.



8
9
10
# File 'lib/rspec/xlsx_matchers/base_sheet.rb', line 8

def subject
  @subject
end

Instance Method Details

#in_sheet(name) ⇒ Object



18
19
20
21
# File 'lib/rspec/xlsx_matchers/base_sheet.rb', line 18

def in_sheet(name)
  @sheet_name = name
  self
end

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/rspec/xlsx_matchers/base_sheet.rb', line 10

def matches?(subject)
  @subject = subject
  @sheet = find_sheet
  return false if sheet.nil?

  process_sheet
end