Class: Csvtool::Domain::RowRandomizationSession::RandomizationSource

Inherits:
Object
  • Object
show all
Defined in:
lib/csvtool/domain/row_randomization_session/randomization_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, separator:, headers_present:) ⇒ RandomizationSource

Returns a new instance of RandomizationSource.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
# File 'lib/csvtool/domain/row_randomization_session/randomization_source.rb', line 9

def initialize(path:, separator:, headers_present:)
  raise ArgumentError, "path cannot be empty" if path.to_s.empty?
  raise ArgumentError, "separator cannot be empty" if separator.to_s.empty?

  @path = path
  @separator = separator
  @headers_present = headers_present
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/csvtool/domain/row_randomization_session/randomization_source.rb', line 7

def path
  @path
end

#separatorObject (readonly)

Returns the value of attribute separator.



7
8
9
# File 'lib/csvtool/domain/row_randomization_session/randomization_source.rb', line 7

def separator
  @separator
end

Instance Method Details

#headers_present?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/csvtool/domain/row_randomization_session/randomization_source.rb', line 18

def headers_present?
  @headers_present
end