Class: Jekyll::Premonition::Attributes::Stacker
- Inherits:
-
Object
- Object
- Jekyll::Premonition::Attributes::Stacker
- Defined in:
- lib/premonition/attributes/stacker.rb
Overview
Instances of this class are pushed onto the parser stack upon parsing of block attributes.
Instance Attribute Summary collapse
-
#meta ⇒ Object
Get and set meta attributes for stacker.
-
#type ⇒ Object
readonly
Get the stacker type.
-
#value ⇒ Object
readonly
Get the string value from the stacker.
Instance Method Summary collapse
-
#append(char) ⇒ Object
Append a char to the stacker value.
-
#initialize(type) ⇒ Stacker
constructor
Initialize a new Stacker.
Constructor Details
#initialize(type) ⇒ Stacker
Initialize a new Stacker
type - The stacker type
20 21 22 23 24 |
# File 'lib/premonition/attributes/stacker.rb', line 20 def initialize(type) @value = nil @type = type = {} end |
Instance Attribute Details
#meta ⇒ Object
Get and set meta attributes for stacker. Used for setting value mode.
15 16 17 |
# File 'lib/premonition/attributes/stacker.rb', line 15 def end |
#type ⇒ Object (readonly)
Get the stacker type. 0 = outside block, 1 = in_between, 2 = key, 3 = value
13 14 15 |
# File 'lib/premonition/attributes/stacker.rb', line 13 def type @type end |
#value ⇒ Object (readonly)
Get the string value from the stacker
11 12 13 |
# File 'lib/premonition/attributes/stacker.rb', line 11 def value @value end |
Instance Method Details
#append(char) ⇒ Object
Append a char to the stacker value
27 28 29 |
# File 'lib/premonition/attributes/stacker.rb', line 27 def append(char) @value = @value.nil? ? char : "#{@value}#{char}" end |