Class: CSVPlusPlus::Modifier::ConditionalFormatting

Inherits:
Object
  • Object
show all
Defined in:
lib/csv_plus_plus/modifier/conditional_formatting.rb

Overview

A class that handles the rules for modifiers to support conditional formatting.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ConditionalFormatting

Returns a new instance of ConditionalFormatting.

Parameters:

  • value (::String)

    The unparsed conditional formatting rule



11
12
13
14
15
# File 'lib/csv_plus_plus/modifier/conditional_formatting.rb', line 11

def initialize(value)
  condition, args = value.split(/\si:\s*/)
  @condition = condition.to_sym
  @arguments = args.split(/\s+/)
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



8
9
10
# File 'lib/csv_plus_plus/modifier/conditional_formatting.rb', line 8

def arguments
  @arguments
end

#conditionObject (readonly)

Returns the value of attribute condition.



8
9
10
# File 'lib/csv_plus_plus/modifier/conditional_formatting.rb', line 8

def condition
  @condition
end

#invalid_reasonObject (readonly)

Returns the value of attribute invalid_reason.



8
9
10
# File 'lib/csv_plus_plus/modifier/conditional_formatting.rb', line 8

def invalid_reason
  @invalid_reason
end