Class: Tent::BufferedCall
- Inherits:
-
Object
- Object
- Tent::BufferedCall
- Defined in:
- lib/tent.rb
Overview
Wrap calls to the underlying.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #apply_to(target) ⇒ Object
-
#initialize(name, *args, &block) ⇒ BufferedCall
constructor
A new instance of BufferedCall.
- #matched_by?(filters) ⇒ Boolean
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
47 48 49 |
# File 'lib/tent.rb', line 47 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
47 48 49 |
# File 'lib/tent.rb', line 47 def block @block end |
#name ⇒ Object (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
59 60 61 |
# File 'lib/tent.rb', line 59 def matched_by?(filters) 0 == filters.length || filters.include?(name) end |