Class: BoxCutter::BoxHelpers::BoxOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/box-cutter/helpers/box_helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ BoxOptions

Returns a new instance of BoxOptions.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/box-cutter/helpers/box_helpers.rb', line 7

def initialize(options={})
  @title = options[:title] || ''
  @if = options[:if] || 1
  @span = options[:span]
  @span.try(:prepend, 'span')
  @klass = options[:class]
  @color = options[:color]
  @color.try(:insert, 0, 'box-')
  @offset = options[:offset]
  @offset.try(:prepend, 'offset')
  @padding = options[:padding] || 20
  @links = options[:links]
  @links = @links ? !options[:links][0].is_a?(Array) ? [@links] : @links : []
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def color
  @color
end

#ifObject (readonly)

Returns the value of attribute if.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def if
  @if
end

#klassObject (readonly)

Returns the value of attribute klass.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def klass
  @klass
end

Returns the value of attribute links.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def links
  @links
end

#offsetObject (readonly)

Returns the value of attribute offset.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def offset
  @offset
end

#paddingObject (readonly)

Returns the value of attribute padding.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def padding
  @padding
end

#spanObject (readonly)

Returns the value of attribute span.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def span
  @span
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5

def title
  @title
end