Class: Pinglish::Check
- Inherits:
-
Object
- Object
- Pinglish::Check
- Defined in:
- lib/pinglish/check.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#call(*args, &block) ⇒ Object
Call this check’s behavior, returning the result of the block.
-
#initialize(name, options = nil, &block) ⇒ Check
constructor
A new instance of Check.
Constructor Details
#initialize(name, options = nil, &block) ⇒ Check
Returns a new instance of Check.
7 8 9 10 11 12 13 |
# File 'lib/pinglish/check.rb', line 7 def initialize(name, = nil, &block) ||= {} @group = [:group] @name = name @timeout = [:timeout] || 1 @block = block end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
3 4 5 |
# File 'lib/pinglish/check.rb', line 3 def group @group end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pinglish/check.rb', line 4 def name @name end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/pinglish/check.rb', line 5 def timeout @timeout end |
Instance Method Details
#call(*args, &block) ⇒ Object
Call this check’s behavior, returning the result of the block.
17 18 19 |
# File 'lib/pinglish/check.rb', line 17 def call(*args, &block) @block.call *args, &block end |