Class: Gitlab::Ci::Build::Hook
- Inherits:
-
Object
- Object
- Gitlab::Ci::Build::Hook
- Defined in:
- lib/gitlab/ci/build/hook.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, script) ⇒ Hook
constructor
A new instance of Hook.
Constructor Details
#initialize(name, script) ⇒ Hook
Returns a new instance of Hook.
17 18 19 20 |
# File 'lib/gitlab/ci/build/hook.rb', line 17 def initialize(name, script) @name = name @script = script end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/gitlab/ci/build/hook.rb', line 7 def name @name end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
7 8 9 |
# File 'lib/gitlab/ci/build/hook.rb', line 7 def script @script end |
Class Method Details
.from_hooks(job) ⇒ Object
10 11 12 13 14 |
# File 'lib/gitlab/ci/build/hook.rb', line 10 def from_hooks(job) job.[:hooks].to_a.map do |name, script| new(name.to_s, script) end end |