Class: Mercurial::Hook
- Inherits:
-
Object
- Object
- Mercurial::Hook
- Defined in:
- lib/mercurial-ruby/hook.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #destroy! ⇒ Object
-
#initialize(repository, name, value) ⇒ Hook
constructor
A new instance of Hook.
- #save ⇒ Object
Constructor Details
#initialize(repository, name, value) ⇒ Hook
Returns a new instance of Hook.
7 8 9 10 11 |
# File 'lib/mercurial-ruby/hook.rb', line 7 def initialize(repository, name, value) @repository = repository @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/mercurial-ruby/hook.rb', line 5 def name @name end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
5 6 7 |
# File 'lib/mercurial-ruby/hook.rb', line 5 def repository @repository end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/mercurial-ruby/hook.rb', line 5 def value @value end |
Instance Method Details
#destroy! ⇒ Object
17 18 19 |
# File 'lib/mercurial-ruby/hook.rb', line 17 def destroy! repository.config.delete_setting!('hooks', name) end |
#save ⇒ Object
13 14 15 |
# File 'lib/mercurial-ruby/hook.rb', line 13 def save repository.config.add_setting('hooks', name, value) end |