Class: Diogenes::DSL::Rule
- Inherits:
-
Object
- Object
- Diogenes::DSL::Rule
- Defined in:
- lib/diogenes/dsl/rule.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#content(value = nil) ⇒ Object
: (?String?) -> String?.
-
#description(value = nil) ⇒ Object
: (?String?) -> String?.
-
#initialize(name, &block) ⇒ Rule
constructor
: (String, ?Proc) -> void.
Constructor Details
#initialize(name, &block) ⇒ Rule
: (String, ?Proc) -> void
10 11 12 13 14 |
# File 'lib/diogenes/dsl/rule.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/rule.rb', line 7 def name @name end |
Instance Method Details
#content(value = nil) ⇒ Object
: (?String?) -> String?
23 24 25 26 |
# File 'lib/diogenes/dsl/rule.rb', line 23 def content(value = nil) @content = value unless value.nil? @content end |
#description(value = nil) ⇒ Object
: (?String?) -> String?
17 18 19 20 |
# File 'lib/diogenes/dsl/rule.rb', line 17 def description(value = nil) @description = value unless value.nil? @description end |