class TTY::Table::BorderOptions
A class that represents table border options
Used internally by {Table::Border} to manage options such as style
@api private
Public Class Methods
from(value)
click to toggle source
Create options instance from hash
@api public
# File lib/tty/table/border_options.rb, line 21 def self.from(value) value ? new.update(value) : new end
new(*args)
click to toggle source
@api public
Calls superclass method
# File lib/tty/table/border_options.rb, line 13 def initialize(*args) super(*args) self.characters = {} unless characters end
Public Instance Methods
to_hash()
click to toggle source
Convert to hash
@api public
# File lib/tty/table/border_options.rb, line 42 def to_hash hash = {} members.each do |key| value = send(key) hash[key.to_sym] = value if value end hash end
update(obj)
click to toggle source
Set all accessors with hash attributes
@param [Hash, BorderOptions] obj
@return [BorderOptions]
@api public
# File lib/tty/table/border_options.rb, line 32 def update(obj) obj.each_pair do |key, value| send("#{key}=", value) end self end