Class: Perfer::Job
- Inherits:
-
Object
show all
- Defined in:
- lib/perfer/job.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(session, title, &block) ⇒ Job
Returns a new instance of Job.
4
5
6
7
8
|
# File 'lib/perfer/job.rb', line 4
def initialize(session, title, &block)
@session = session
@title = title
@block = block
end
|
Instance Attribute Details
Returns the value of attribute metadata.
3
4
5
|
# File 'lib/perfer/job.rb', line 3
def metadata
@metadata
end
|
#session ⇒ Object
Returns the value of attribute session.
3
4
5
|
# File 'lib/perfer/job.rb', line 3
def session
@session
end
|
#title ⇒ Object
Returns the value of attribute title.
3
4
5
|
# File 'lib/perfer/job.rb', line 3
def title
@title
end
|
Instance Method Details
10
11
12
13
14
|
# File 'lib/perfer/job.rb', line 10
def load_metadata
@metadata = @session.metadata.merge(:job => @title)
@metadata.merge!(@session.next_job_metadata) if @session.next_job_metadata
@metadata.freeze
end
|
#minimal_time ⇒ Object
20
21
22
|
# File 'lib/perfer/job.rb', line 20
def minimal_time
Perfer.configuration.minimal_time
end
|
#number_of_measurements ⇒ Object
24
25
26
|
# File 'lib/perfer/job.rb', line 24
def number_of_measurements
Perfer.configuration.measurements
end
|
#results ⇒ Object
16
17
18
|
# File 'lib/perfer/job.rb', line 16
def results
@session.results.select { |result| result[:job] == @title }
end
|
#run ⇒ Object
32
33
34
|
# File 'lib/perfer/job.rb', line 32
def run
@session.current_job = self
end
|