Class: Axlsx::Filters::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/axlsx/workbook/worksheet/auto_filter/filters.rb

Overview

This class expresses a filter criteria value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Filter

Creates a new filter value object

Parameters:

  • value (Any)

    The value of the filter. This is not restricted, but will be serialized via to_s so if you are passing an object be careful.



121
122
123
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 121

def initialize(value)
  @val = value
end

Instance Attribute Details

#valObject

Filter value used in the criteria.



127
128
129
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 127

def val
  @val
end

Instance Method Details

#to_xml_string(str = '') ⇒ Object

Serializes the filter value object

Parameters:

  • str (String) (defaults to: '')

    The string to concact the serialization information to.



131
132
133
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 131

def to_xml_string(str = '')
  str << "<filter val='#{@val.to_s}' />"
end