Class: Laborantin::Metaprog::Verifications::Verification
- Inherits:
-
Object
- Object
- Laborantin::Metaprog::Verifications::Verification
- Includes:
- Describable, Resolutions, InstanceMethods
- Defined in:
- lib/laborantin/core/verifications.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from InstanceMethods
Attributes included from Resolutions::InstanceMethods
Attributes included from Describable
Instance Method Summary collapse
- #check(&blk) ⇒ Object
- #correct?(*ary) ⇒ Boolean
-
#initialize(name) ⇒ Verification
constructor
A new instance of Verification.
Methods included from InstanceMethods
Methods included from Resolutions::InstanceMethods
Constructor Details
#initialize(name) ⇒ Verification
Returns a new instance of Verification.
31 32 33 |
# File 'lib/laborantin/core/verifications.rb', line 31 def initialize(name) @name = name end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
30 31 32 |
# File 'lib/laborantin/core/verifications.rb', line 30 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/laborantin/core/verifications.rb', line 30 def name @name end |
Instance Method Details
#check(&blk) ⇒ Object
35 36 37 |
# File 'lib/laborantin/core/verifications.rb', line 35 def check(&blk) @block = blk end |
#correct?(*ary) ⇒ Boolean
39 40 41 42 |
# File 'lib/laborantin/core/verifications.rb', line 39 def correct?(*ary) raise RuntimeError, "no block for verification #{self}" unless block block.call(*ary) && valid?(*ary) end |