Class: HooplaSalesforce::TemplateProcessor::TestPage

Inherits:
Base
  • Object
show all
Defined in:
lib/hoopla_salesforce/template_processor.rb

Instance Attribute Summary

Attributes inherited from Base

#base, #file, #src

Instance Method Summary collapse

Methods inherited from Base

#each_resource_file, #initialize

Methods included from CaptureHelper

#capture

Constructor Details

This class inherits a constructor from HooplaSalesforce::TemplateProcessor::Base

Instance Method Details

#as_json_array(collection, var) ⇒ Object



112
113
114
# File 'lib/hoopla_salesforce/template_processor.rb', line 112

def as_json_array(collection, var)
  send("#{var}_json")
end

#end_pageObject



89
90
91
92
93
94
# File 'lib/hoopla_salesforce/template_processor.rb', line 89

def end_page
  <<-EOS.margin
    </body>
    </html>
  EOS
end

#javascript_include_tag(*files) ⇒ Object



106
107
108
109
110
# File 'lib/hoopla_salesforce/template_processor.rb', line 106

def javascript_include_tag(*files)
  each_resource_file(files, "js") do |file|
    %Q|<script type="text/javascript" src="#{resource_url(file)}"></script>|
  end
end

#output_fileObject



116
117
118
# File 'lib/hoopla_salesforce/template_processor.rb', line 116

def output_file
  "#{src}/pages-test/#{base}.html"
end

#page(opts = {}) ⇒ Object



79
80
81
82
83
84
85
86
87
# File 'lib/hoopla_salesforce/template_processor.rb', line 79

def page(opts={})
  <<-EOS.margin
    <html>
      <head>
        <title>Test Page: #{opts[:controller]}</title>
      </head>
      <body>
  EOS
end

#resource_url(file) ⇒ Object



96
97
98
# File 'lib/hoopla_salesforce/template_processor.rb', line 96

def resource_url(file)
  "../resources/#{file}"
end

#stylesheet_include_tag(*files) ⇒ Object



100
101
102
103
104
# File 'lib/hoopla_salesforce/template_processor.rb', line 100

def stylesheet_include_tag(*files)
  each_resource_file(files, "css") do |file|
    %Q|<link rel="stylesheet" type="text/css" href="#{resource_url(file)}" />|
  end
end