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.



116
117
118
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 116

def initialize(value)
  @val = value
end

Instance Attribute Details

#valObject

Filter value used in the criteria.



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

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.



125
126
127
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 125

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