Class: ToSpreadsheet::Rule::Sheet

Inherits:
Base
  • Object
show all
Defined in:
lib/to_spreadsheet/rule/sheet.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #selector_query, #selector_type

Instance Method Summary collapse

Methods inherited from Base

#applies_to?, #initialize, #to_s, #type

Methods included from Selectors

#column_number_match?, #css_match, #css_match?, #each_cell, #query_match?, #range_contains?, #range_match, #row_number_match?

Constructor Details

This class inherits a constructor from ToSpreadsheet::Rule::Base

Instance Method Details

#apply(context, sheet) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/to_spreadsheet/rule/sheet.rb', line 4

def apply(context, sheet)
  options.each { |k, v|
    if v.is_a?(Hash)
      sub = sheet.send(k)
      v.each do |sub_k, sub_v|
        sub.send :"#{sub_k}=", sub_v
      end
    else
      sheet.send :"#{k}=", v
    end
  }
end