Class: Toys::Template
- Inherits:
-
Object
- Object
- Toys::Template
- Defined in:
- lib/toys/template.rb
Instance Attribute Summary collapse
-
#expander ⇒ Object
readonly
Returns the value of attribute expander.
-
#opts_initializer ⇒ Object
readonly
Returns the value of attribute opts_initializer.
Instance Method Summary collapse
-
#initialize ⇒ Template
constructor
A new instance of Template.
- #to_expand(&block) ⇒ Object
- #to_init_opts(&block) ⇒ Object
Constructor Details
#initialize ⇒ Template
Returns a new instance of Template.
3 4 5 6 |
# File 'lib/toys/template.rb', line 3 def initialize @opts_initializer = ->(opts){opts} @expander = ->(opts){} end |
Instance Attribute Details
#expander ⇒ Object (readonly)
Returns the value of attribute expander.
19 20 21 |
# File 'lib/toys/template.rb', line 19 def @expander end |
#opts_initializer ⇒ Object (readonly)
Returns the value of attribute opts_initializer.
18 19 20 |
# File 'lib/toys/template.rb', line 18 def opts_initializer @opts_initializer end |
Instance Method Details
#to_expand(&block) ⇒ Object
13 14 15 16 |
# File 'lib/toys/template.rb', line 13 def (&block) @expander = block self end |
#to_init_opts(&block) ⇒ Object
8 9 10 11 |
# File 'lib/toys/template.rb', line 8 def to_init_opts(&block) @opts_initializer = block self end |