Class: Ghundle::Hook
- Inherits:
-
Object
- Object
- Ghundle::Hook
- Defined in:
- lib/ghundle/hook.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ Hook
constructor
A new instance of Hook.
- #metadata ⇒ Object
- #name ⇒ Object
- #run(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(source) ⇒ Hook
Returns a new instance of Hook.
7 8 9 |
# File 'lib/ghundle/hook.rb', line 7 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/ghundle/hook.rb', line 5 def source @source end |
Instance Method Details
#metadata ⇒ Object
15 16 17 |
# File 'lib/ghundle/hook.rb', line 15 def source. end |
#name ⇒ Object
11 12 13 |
# File 'lib/ghundle/hook.rb', line 11 def name source.name end |
#run(*args) ⇒ Object
19 20 21 22 |
# File 'lib/ghundle/hook.rb', line 19 def run(*args) source.validate system source.script_path.to_s, *args end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/ghundle/hook.rb', line 24 def to_s name end |