Class: Steep::Drivers::Utils::JobsOption
- Defined in:
- lib/steep/drivers/utils/jobs_option.rb
Instance Attribute Summary collapse
-
#jobs_count ⇒ Object
Returns the value of attribute jobs_count.
-
#jobs_count_modifier ⇒ Object
Returns the value of attribute jobs_count_modifier.
-
#steep_command ⇒ Object
Returns the value of attribute steep_command.
Instance Method Summary collapse
- #default_jobs_count ⇒ Object
-
#initialize(jobs_count_modifier: 0) ⇒ JobsOption
constructor
A new instance of JobsOption.
- #jobs_count_value ⇒ Object
Constructor Details
#initialize(jobs_count_modifier: 0) ⇒ JobsOption
Returns a new instance of JobsOption.
7 8 9 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 7 def initialize(jobs_count_modifier: 0) @jobs_count_modifier = jobs_count_modifier end |
Instance Attribute Details
#jobs_count ⇒ Object
Returns the value of attribute jobs_count.
5 6 7 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 5 def jobs_count @jobs_count end |
#jobs_count_modifier ⇒ Object
Returns the value of attribute jobs_count_modifier.
5 6 7 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 5 def jobs_count_modifier @jobs_count_modifier end |
#steep_command ⇒ Object
Returns the value of attribute steep_command.
5 6 7 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 5 def steep_command @steep_command end |
Instance Method Details
#default_jobs_count ⇒ Object
11 12 13 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 11 def default_jobs_count Concurrent.physical_processor_count + jobs_count_modifier end |
#jobs_count_value ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/steep/drivers/utils/jobs_option.rb', line 15 def jobs_count_value count = jobs_count || default_jobs_count if count >= 1 count else 1 end end |