Class: Diogenes::DSL::Hook
- Inherits:
-
Object
- Object
- Diogenes::DSL::Hook
- Defined in:
- lib/diogenes/dsl/hook.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Hook
constructor
: (String, ?Proc) -> void.
-
#prompt(value = nil) ⇒ Object
: (?String?) -> String?.
-
#trigger(value = nil) ⇒ Object
: (?String?) -> String?.
Constructor Details
#initialize(name, &block) ⇒ Hook
: (String, ?Proc) -> void
10 11 12 13 14 |
# File 'lib/diogenes/dsl/hook.rb', line 10 def initialize(name, &block) @name = name #: String instance_eval(&block) if block_given? validate! end |
Instance Attribute Details
#name ⇒ Object (readonly)
: String
7 8 9 |
# File 'lib/diogenes/dsl/hook.rb', line 7 def name @name end |
Instance Method Details
#prompt(value = nil) ⇒ Object
: (?String?) -> String?
23 24 25 26 |
# File 'lib/diogenes/dsl/hook.rb', line 23 def prompt(value = nil) @prompt = value unless value.nil? @prompt end |
#trigger(value = nil) ⇒ Object
: (?String?) -> String?
17 18 19 20 |
# File 'lib/diogenes/dsl/hook.rb', line 17 def trigger(value = nil) @trigger = value unless value.nil? @trigger end |