Sha256: e0a77ac04e755805c6c164603ebf815a84d48e33991a7c910c13566496fe5921
Contents?: true
Size: 1.13 KB
Versions: 13
Compression:
Stored size: 1.13 KB
Contents
# encoding: utf-8 module TTY class Table # A class that represents table border options # # Used internally by {Table::Border} to manage options such as style # # @api private class BorderOptions < Struct.new(:characters, :separator, :style) # Initialize a BorderOptions # # @api public def initialize(*args) super(*args) self.characters = {} unless characters end # Create options instance from hash # # @api public def self.from(value) value ? new.update(value) : new end # Set all accessors with hash attributes # # @param [Hash, BorderOptions] obj # # @return [BorderOptions] # # @api public def update(obj) obj.each_pair do |key, value| send("#{key}=", value) end self end # Convert to hash # # @api public def to_hash hash = {} members.each do |key| value = send(key) hash[key.to_sym] = value if value end hash end end # BorderOptions end # Table end # TTY
Version data entries
13 entries across 13 versions & 2 rubygems