class Caracal::Core::Models::BorderModel
This class handles block options passed to the page margins method.
Attributes
border_color[R]
accessors
border_line[R]
border_size[R]
border_spacing[R]
border_type[R]
Public Class Methods
formatted_type(type)
click to toggle source
# File lib/caracal/core/models/border_model.rb, line 47 def self.formatted_type(type) case type.to_s.to_sym when :horizontal then 'insideH' when :vertical then 'insideV' when :top then 'top' when :bottom then 'bottom' when :left then 'left' when :right then 'right' else nil end end
new(options={}, &block)
click to toggle source
initialization
Calls superclass method
Caracal::Core::Models::BaseModel::new
# File lib/caracal/core/models/border_model.rb, line 32 def initialize(options={}, &block) @border_color = DEFAULT_BORDER_COLOR @border_line = DEFAULT_BORDER_LINE @border_size = DEFAULT_BORDER_SIZE @border_spacing = DEFAULT_BORDER_SPACING @border_type = DEFAULT_BORDER_TYPE super options, &block end
Public Instance Methods
formatted_type()
click to toggle source
total_size()
click to toggle source
# File lib/caracal/core/models/border_model.rb, line 70 def total_size border_size + (2 * border_spacing) end
Private Instance Methods
option_keys()
click to toggle source
# File lib/caracal/core/models/border_model.rb, line 112 def option_keys [:color, :line, :size, :spacing, :type] end