Class: OroGen::HTML::TaskContext
- Inherits:
-
Object
- Object
- OroGen::HTML::TaskContext
- Defined in:
- lib/orogen/html/task_context.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(page) ⇒ TaskContext
constructor
A new instance of TaskContext.
- #render(task, options = Hash.new) ⇒ Object
Constructor Details
#initialize(page) ⇒ TaskContext
Returns a new instance of TaskContext
8 9 10 11 12 13 |
# File 'lib/orogen/html/task_context.rb', line 8 def initialize(page) path = File.join(File.dirname(__FILE__), "task_context_fragment.page") @template = ERB.new(File.read(path)) @template.filename = path @page = page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page
4 5 6 |
# File 'lib/orogen/html/task_context.rb', line 4 def page @page end |
#task ⇒ Object (readonly)
Returns the value of attribute task
5 6 7 |
# File 'lib/orogen/html/task_context.rb', line 5 def task @task end |
#template ⇒ Object (readonly)
Returns the value of attribute template
6 7 8 |
# File 'lib/orogen/html/task_context.rb', line 6 def template @template end |
Instance Method Details
#render(task, options = Hash.new) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/orogen/html/task_context.rb', line 15 def render(task, = Hash.new) , = Kernel. , :doc => true, :external_objects => nil @task = task if [:doc] && task.doc page.push nil, page.main_doc(task.doc) end page.push(nil, template.result(binding), ) end |