Class: Toys::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/toys/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemplate

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

#expanderObject (readonly)

Returns the value of attribute expander.



19
20
21
# File 'lib/toys/template.rb', line 19

def expander
  @expander
end

#opts_initializerObject (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 to_expand(&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