Class: Tent::BufferedCall

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

Overview

Wrap calls to the underlying.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *args, &block) ⇒ BufferedCall

Returns a new instance of BufferedCall.



49
50
51
52
53
# File 'lib/tent.rb', line 49

def initialize(name, *args, &block)
  @name  = name
  @args  = args
  @block = block
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



47
48
49
# File 'lib/tent.rb', line 47

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



47
48
49
# File 'lib/tent.rb', line 47

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



47
48
49
# File 'lib/tent.rb', line 47

def name
  @name
end

Instance Method Details

#apply_to(target) ⇒ Object



55
56
57
# File 'lib/tent.rb', line 55

def apply_to(target)
  block ? target.send(name, *args, &block) : target.send(name, *args)
end

#matched_by?(filters) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/tent.rb', line 59

def matched_by?(filters)
  0 == filters.length || filters.include?(name)
end