Class: CircleCI::Parallel::Hook Private
- Inherits:
-
Object
- Object
- CircleCI::Parallel::Hook
- Defined in:
- lib/circleci/parallel/hook.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #chdir ⇒ Object readonly private
- #proc ⇒ Object readonly private
Instance Method Summary collapse
- #call(dir) ⇒ Object private
-
#initialize(proc = nil, chdir = true) ⇒ Hook
constructor
private
A new instance of Hook.
Constructor Details
#initialize(proc = nil, chdir = true) ⇒ Hook
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Hook.
7 8 9 10 |
# File 'lib/circleci/parallel/hook.rb', line 7 def initialize(proc = nil, chdir = true) @proc = proc @chdir = chdir end |
Instance Attribute Details
#chdir ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 |
# File 'lib/circleci/parallel/hook.rb', line 5 def chdir @chdir end |
#proc ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 |
# File 'lib/circleci/parallel/hook.rb', line 5 def proc @proc end |
Instance Method Details
#call(dir) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 17 18 19 20 |
# File 'lib/circleci/parallel/hook.rb', line 12 def call(dir) return unless proc if chdir Dir.chdir(dir, &proc) else proc.call(dir) end end |