Class: Ghundle::Hook

Inherits:
Object
  • Object
show all
Defined in:
lib/ghundle/hook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/ghundle/hook.rb', line 5

def source
  @source
end

Instance Method Details

#metadataObject



15
16
17
# File 'lib/ghundle/hook.rb', line 15

def 
  source.
end

#nameObject



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_sObject



24
25
26
# File 'lib/ghundle/hook.rb', line 24

def to_s
  name
end