Class: Pinglish::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/pinglish/check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = nil, &block)
  options ||= {}
  @group    = options[:group]
  @name     = name
  @timeout  = options[:timeout] || 1
  @block    = block
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



3
4
5
# File 'lib/pinglish/check.rb', line 3

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/pinglish/check.rb', line 4

def name
  @name
end

#timeoutObject (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