Class: Proforma::Prototype

Inherits:
Object
  • Object
show all
Defined in:
lib/proforma/prototype.rb

Overview

A prototype is a compiled template that has been flattened and ready for rendering.

Direct Known Subclasses

Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(children: [], title: '') ⇒ Prototype

Returns a new instance of Prototype.



15
16
17
18
# File 'lib/proforma/prototype.rb', line 15

def initialize(children: [], title: '')
  @children = ModelFactory.array(children)
  @title    = title
end

Instance Attribute Details

#childrenObject



20
21
22
# File 'lib/proforma/prototype.rb', line 20

def children
  Array(@children)
end

#titleObject



24
25
26
# File 'lib/proforma/prototype.rb', line 24

def title
  @title.to_s
end