Class: OroGen::HTML::TaskContext

Inherits:
Object
  • Object
show all
Defined in:
lib/orogen/html/task_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pageObject (readonly)

Returns the value of attribute page



4
5
6
# File 'lib/orogen/html/task_context.rb', line 4

def page
  @page
end

#taskObject (readonly)

Returns the value of attribute task



5
6
7
# File 'lib/orogen/html/task_context.rb', line 5

def task
  @task
end

#templateObject (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, options = Hash.new)
    options, push_options = Kernel.filter_options options, :doc => true, :external_objects => nil
    @task = task
    if options[:doc] && task.doc
        page.push nil, page.main_doc(task.doc)
    end
    page.push(nil, template.result(binding), push_options)
end