Module: Peeek::Readily

Defined in:
lib/peeek.rb

Instance Method Summary collapse

Instance Method Details

#peeek(*method_specs) {|call| ... } ⇒ Object

Register a hook to methods of self to the current Peeek object.

Parameters:

  • method_specs (Array<String>, Array<Symbol>)

    method specifiers of the object. see also examples of Hook.create

Yields:

  • (call)

    process a call to the methods. give optionally

Yield Parameters:

See Also:



144
145
146
# File 'lib/peeek.rb', line 144

def peeek(*method_specs, &process)
  Peeek.current.hook(self, *method_specs, &process)
end

#peeek_lazily(*method_specs) {|call| ... } ⇒ Object

Register a hook to methods of an object to the current Peeek object. The object is that is pointed by self, work well even if the object isn’t defined when called this method.

Parameters:

  • Array<String, (Array<String, Array<Symbol>] method_specs method specifiers of the object. see also examples of {Peeek::Hook.create})

    Array<Symbol>] method_specs method specifiers of the object. see also examples of Hook.create

Yields:

  • (call)

    process a call to the methods. give optionally

Yield Parameters:

See Also:



159
160
161
# File 'lib/peeek.rb', line 159

def peeek_lazily(*method_specs, &process)
  Lazy.new(self).peeek(*method_specs, &process)
end