Class: SequencescapeExcel::ConditionalFormattingDefault
- Inherits:
-
Object
- Object
- SequencescapeExcel::ConditionalFormattingDefault
- Includes:
- Helpers::Attributes
- Defined in:
- app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb
Overview
Default conditional formatting rule. See conditional formatting.
Instance Method Summary collapse
- #combine(other = nil) ⇒ Object
- #expression? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ ConditionalFormattingDefault
constructor
A new instance of ConditionalFormattingDefault.
- #inspect ⇒ Object
- #type=(type) ⇒ Object
Methods included from Helpers::Attributes
Constructor Details
#initialize(attributes = {}) ⇒ ConditionalFormattingDefault
Returns a new instance of ConditionalFormattingDefault.
12 13 14 |
# File 'app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb', line 12 def initialize(attributes = {}) super end |
Instance Method Details
#combine(other = nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb', line 24 def combine(other = nil) (other || {}) .merge(style:, options:) .with_indifferent_access .tap do |cf| if expression? cf[:formula] ||= {} cf[:formula].merge!(type:) end end end |
#expression? ⇒ Boolean
20 21 22 |
# File 'app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb', line 20 def expression? [:type] == :expression end |
#inspect ⇒ Object
36 37 38 |
# File 'app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb', line 36 def inspect "<#{self.class}: @type=#{type}, @style=#{style}, @options=#{}>" end |
#type=(type) ⇒ Object
16 17 18 |
# File 'app/sequencescape_excel/sequencescape_excel/conditional_formatting_default.rb', line 16 def type=(type) @type = type.to_sym end |