Class: EmberCLI::Deploy::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/ember-cli/deploy/page.rb

Instance Method Summary collapse

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

#buildObject



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