Class: KeepYourHead::Requirement
- Inherits:
-
Object
- Object
- KeepYourHead::Requirement
- Defined in:
- lib/Keepyourhead/Requirements.rb
Instance Attribute Summary collapse
-
#checkProc ⇒ Object
Returns the value of attribute checkProc.
-
#errorDescription ⇒ Object
Returns the value of attribute errorDescription.
-
#name ⇒ Object
Returns the value of attribute name.
-
#website ⇒ Object
Returns the value of attribute website.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize {|_self| ... } ⇒ Requirement
constructor
A new instance of Requirement.
Constructor Details
#initialize {|_self| ... } ⇒ Requirement
Returns a new instance of Requirement.
4 5 6 |
# File 'lib/Keepyourhead/Requirements.rb', line 4 def initialize yield self end |
Instance Attribute Details
#checkProc ⇒ Object
Returns the value of attribute checkProc.
3 4 5 |
# File 'lib/Keepyourhead/Requirements.rb', line 3 def checkProc @checkProc end |
#errorDescription ⇒ Object
Returns the value of attribute errorDescription.
3 4 5 |
# File 'lib/Keepyourhead/Requirements.rb', line 3 def errorDescription @errorDescription end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/Keepyourhead/Requirements.rb', line 3 def name @name end |
#website ⇒ Object
Returns the value of attribute website.
3 4 5 |
# File 'lib/Keepyourhead/Requirements.rb', line 3 def website @website end |
Instance Method Details
#check ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/Keepyourhead/Requirements.rb', line 7 def check ret = begin @checkProc.call rescue false end if not ret then puts <<-END Requiremente failed ! ------------------------------- #{errorDescription} Please install #{name} #{website} ------------------------------- END end ret end |