Class: BoxCutter::BoxHelpers::BoxOptions
- Inherits:
-
Object
- Object
- BoxCutter::BoxHelpers::BoxOptions
- Defined in:
- lib/box-cutter/helpers/box_helpers.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#if ⇒ Object
readonly
Returns the value of attribute if.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#span ⇒ Object
readonly
Returns the value of attribute span.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ BoxOptions
constructor
A new instance of BoxOptions.
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(={}) @title = [:title] || '' @if = [:if] || 1 @span = [:span] @span.try(:prepend, 'span') @klass = [:class] @color = [:color] @color.try(:insert, 0, 'box-') @offset = [:offset] @offset.try(:prepend, 'offset') @padding = [:padding] || 20 @links = [:links] @links = @links ? ![:links][0].is_a?(Array) ? [@links] : @links : [] end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def color @color end |
#if ⇒ Object (readonly)
Returns the value of attribute if.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def if @if end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def klass @klass end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def links @links end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def offset @offset end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def padding @padding end |
#span ⇒ Object (readonly)
Returns the value of attribute span.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def span @span end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/box-cutter/helpers/box_helpers.rb', line 5 def title @title end |