Class: Rock::HTML::AutoprojPackage
- Inherits:
-
Object
- Object
- Rock::HTML::AutoprojPackage
- Defined in:
- lib/rock/html/autoproj_package.rb
Overview
Rendering object that displays information about autoproj packages
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #api_url(pkg) ⇒ Object
-
#initialize(page) ⇒ AutoprojPackage
constructor
A new instance of AutoprojPackage.
- #render(info, object) ⇒ Object
- #render_vcs(vcs) ⇒ Object
Constructor Details
#initialize(page) ⇒ AutoprojPackage
Returns a new instance of AutoprojPackage
7 8 9 10 |
# File 'lib/rock/html/autoproj_package.rb', line 7 def initialize(page) @page = page @template = page.load_template(TEMPLATE_DIR, 'autoproj_package.page') end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page
5 6 7 |
# File 'lib/rock/html/autoproj_package.rb', line 5 def page @page end |
#template ⇒ Object (readonly)
Returns the value of attribute template
5 6 7 |
# File 'lib/rock/html/autoproj_package.rb', line 5 def template @template end |
Instance Method Details
#api_url(pkg) ⇒ Object
16 17 18 19 20 |
# File 'lib/rock/html/autoproj_package.rb', line 16 def api_url(pkg) if page.respond_to?(:api_url) && (url = page.api_url(pkg)) url end end |
#render(info, object) ⇒ Object
12 13 14 |
# File 'lib/rock/html/autoproj_package.rb', line 12 def render(info, object) page.push nil, template.result(binding) end |
#render_vcs(vcs) ⇒ Object
22 23 24 |
# File 'lib/rock/html/autoproj_package.rb', line 22 def render_vcs(vcs) MetaRuby::GUI::HTML::Page.to_html_body(vcs, AutoprojVCS) end |