Class: EmberCLI::Deploy::Page
- Inherits:
-
Object
- Object
- EmberCLI::Deploy::Page
- Defined in:
- lib/ember-cli/deploy/page.rb
Instance Method Summary collapse
- #append_to_body(markup) ⇒ Object
- #append_to_head(markup) ⇒ Object
- #build ⇒ Object
-
#initialize(html:) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(html:) ⇒ Page
Returns a new instance of Page.
4 5 6 7 8 |
# File 'lib/ember-cli/deploy/page.rb', line 4 def initialize(html:) @html = html.clone @body_markup = [] @head_markup = [] end |
Instance Method Details
#append_to_body(markup) ⇒ Object
26 27 28 |
# File 'lib/ember-cli/deploy/page.rb', line 26 def append_to_body(markup) body_markup << markup end |
#append_to_head(markup) ⇒ Object
30 31 32 |
# File 'lib/ember-cli/deploy/page.rb', line 30 def append_to_head(markup) head_markup << markup end |
#build ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ember-cli/deploy/page.rb', line 10 def build if has_head? head_markup.each do |markup| html.insert(head_position, markup) end end if has_body? body_markup.each do |markup| html.insert(body_position, markup) end end html end |