def horizontal(type)
Returns:
-
(Array)
- a 6 element list of: [i-left, horizontal-bar, i-up/down, i-right, i-down, i-up]
def horizontal(type)
raise ArgumentError, "Border type is #{type.inspect}, must be one of #{ALLOWED_SEPARATOR_BORDER_STYLES.inspect}" unless ALLOWED_SEPARATOR_BORDER_STYLES.include?(type)
lookup = case type
when :top
[:nw, :nx, :n, :ne, :n, nil]
when :bot
[:sw, :sx, :s, :se, nil, :s]
when :double
# typically used for the separator below the heading row or above a footer row)
[:aw, :ax, :ai, :ae, :ad, :au]
when :thick, :thick_dash, :thick_dot3, :thick_dot4,
:heavy, :heavy_dash, :heavy_dot3, :heavy_dot4,
:bold, :bold_dash, :bold_dot3, :bold_dot4
# alternate thick/bold border
xref = type.to_s.sub(/^(thick|heavy|bold)/,'bx').to_sym
[:bw, xref, :bi, :be, :bd, :bu]
when :dash, :dot3, :dot4
# alternate thin dividers
xref = "x_#{type}".to_sym
[:w, xref, :i, :e, :dn, :up]
else # :div (center, non-emphasized)
[:w, :x, :i, :e, :dn, :up]
end
rval = lookup.map { |key| @data.fetch(key) }
rval[0] = '' unless @left
rval[3] = '' unless @right
rval
end