Class: OsCtld::Hook::Script
- Inherits:
-
Object
- Object
- OsCtld::Hook::Script
- Defined in:
- lib/osctld/hook/script.rb
Instance Attribute Summary collapse
-
#abs_path ⇒ String
readonly
Absolute path to the script.
-
#base_name ⇒ String
readonly
Base file name.
-
#name ⇒ Symbol
readonly
Hook name.
-
#rel_path ⇒ String
readonly
Relative path to the script from the ‘s hook directory.
Instance Method Summary collapse
-
#initialize(name, abs_path, rel_path) ⇒ Script
constructor
A new instance of Script.
Constructor Details
#initialize(name, abs_path, rel_path) ⇒ Script
Returns a new instance of Script.
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_path ⇒ String (readonly)
Absolute path to the script
9 10 11 |
# File 'lib/osctld/hook/script.rb', line 9 def abs_path @abs_path end |
#base_name ⇒ String (readonly)
Base file name
17 18 19 |
# File 'lib/osctld/hook/script.rb', line 17 def base_name @base_name end |
#name ⇒ Symbol (readonly)
Hook name
5 6 7 |
# File 'lib/osctld/hook/script.rb', line 5 def name @name end |
#rel_path ⇒ String (readonly)
Relative path to the script from the ‘s hook directory
13 14 15 |
# File 'lib/osctld/hook/script.rb', line 13 def rel_path @rel_path end |