Class: OsCtld::Hook::Script

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, abs_path, rel_path) ⇒ Script

Returns a new instance of Script.

Parameters:

  • name (Symbol)
  • abs_path (String)
  • rel_path (String)


22
23
24
25
26
27
# File 'lib/osctld/hook/script.rb', line 22

def initialize(name, abs_path, rel_path)
  @name = name
  @abs_path = abs_path
  @rel_path = rel_path
  @base_name = File.basename(rel_path)
end

Instance Attribute Details

#abs_pathString (readonly)

Absolute path to the script

Returns:

  • (String)


9
10
11
# File 'lib/osctld/hook/script.rb', line 9

def abs_path
  @abs_path
end

#base_nameString (readonly)

Base file name

Returns:

  • (String)


17
18
19
# File 'lib/osctld/hook/script.rb', line 17

def base_name
  @base_name
end

#nameSymbol (readonly)

Hook name

Returns:

  • (Symbol)


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

def name
  @name
end

#rel_pathString (readonly)

Relative path to the script from the ‘s hook directory

Returns:

  • (String)


13
14
15
# File 'lib/osctld/hook/script.rb', line 13

def rel_path
  @rel_path
end