Class: TableTransform::Table::TableProperties

Inherits:
Properties
  • Object
show all
Defined in:
lib/table_transform/table.rb

Overview

Table properties

Instance Method Summary collapse

Methods inherited from Properties

#initialize, #reset, #to_h, #update

Constructor Details

This class inherits a constructor from TableTransform::Properties

Instance Method Details

#validate(properties) ⇒ Object



184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/table_transform/table.rb', line 184

def validate(properties)
  super
  properties.each { |k, v|
    case k
      when :name
        raise "Table property '#{k}' expected to be a non-empty string" unless v.is_a?(String) && !v.empty?
      when :auto_filter
        raise "Table property '#{k}' expected to be a boolean" unless !!v == v
      else
        raise "Table property unknown '#{k}'"
    end
  }
end