Class: Stencil::Template::State
- Inherits:
-
Object
- Object
- Stencil::Template::State
- Defined in:
- lib/stencil/template.rb,
lib/stencil/directives/term-style.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #get_template(path) ⇒ Object
-
#initialize(data, &file_opener) ⇒ State
constructor
A new instance of State.
- #terminal_style ⇒ Object
- #terminal_style=(style) ⇒ Object
Constructor Details
#initialize(data, &file_opener) ⇒ State
Returns a new instance of State.
126 127 128 129 |
# File 'lib/stencil/template.rb', line 126 def initialize(data, &file_opener) @data = data @file_opener = file_opener end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
135 136 137 |
# File 'lib/stencil/template.rb', line 135 def data @data end |
Instance Method Details
#get_template(path) ⇒ Object
131 132 133 |
# File 'lib/stencil/template.rb', line 131 def get_template(path) Template::file(path, &@file_opener) end |
#terminal_style ⇒ Object
44 45 46 47 48 49 |
# File 'lib/stencil/directives/term-style.rb', line 44 def terminal_style @style ||= Styles.keys.inject({}){|style, key| style.merge({key => 'default'}) } return @style end |
#terminal_style=(style) ⇒ Object
51 52 53 |
# File 'lib/stencil/directives/term-style.rb', line 51 def terminal_style=(style) @style = style end |