Class: Shoestring::Generic
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(name, message = "Unable to check #{name}", &block) ⇒ Generic
constructor
A new instance of Generic.
Methods inherited from Base
Constructor Details
#initialize(name, message = "Unable to check #{name}", &block) ⇒ Generic
Returns a new instance of Generic.
5 6 7 8 9 |
# File 'lib/shoestring/generic.rb', line 5 def initialize(name, ="Unable to check #{name}", &block) @name = name @message = @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/shoestring/generic.rb', line 3 def block @block end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/shoestring/generic.rb', line 3 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/shoestring/generic.rb', line 3 def name @name end |
Instance Method Details
#check ⇒ Object
11 12 13 14 |
# File 'lib/shoestring/generic.rb', line 11 def check block.call || abort() puts "#{name}: check!" end |