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.



112
113
114
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 112

def initialize(value)
  @val = value
end

Instance Attribute Details

#valObject

Filter value used in the criteria.



118
119
120
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 118

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.



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

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