class TTY::Table::Options
Structure for holding table options with indifferent access
Public Class Methods
new(hash={}, &block)
click to toggle source
Calls superclass method
# File lib/tty/table/options.rb, line 10 def initialize(hash={}, &block) super(&block) hash.each do |key, value| self[convert_key(key)] = valu end end
Public Instance Methods
[]=(key, value)
click to toggle source
Calls superclass method
# File lib/tty/table/options.rb, line 18 def []=(key, value) super(convert_key(key), value) end
convert_key(key)
click to toggle source
# File lib/tty/table/options.rb, line 22 def convert_key(key) key.is_a?(Symbol) ? key.to_s : key end