Class: Shoehorn::HelperCollection
- Inherits:
-
Object
- Object
- Shoehorn::HelperCollection
show all
- Defined in:
- lib/shoehorn/helper_collection.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HelperCollection.
5
6
7
8
|
# File 'lib/shoehorn/helper_collection.rb', line 5
def initialize(view)
@view = view
@calls = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args, &block) ⇒ Object
10
11
12
|
# File 'lib/shoehorn/helper_collection.rb', line 10
def method_missing(symbol, *args, &block)
@calls << HelperMethodCall.new(@view, symbol, args, block)
end
|
Instance Attribute Details
#calls ⇒ Object
Returns the value of attribute calls.
3
4
5
|
# File 'lib/shoehorn/helper_collection.rb', line 3
def calls
@calls
end
|
#view ⇒ Object
Returns the value of attribute view.
3
4
5
|
# File 'lib/shoehorn/helper_collection.rb', line 3
def view
@view
end
|
Instance Method Details
#[](x) ⇒ Object
20
21
22
|
# File 'lib/shoehorn/helper_collection.rb', line 20
def [](x)
@calls[x]
end
|
#each ⇒ Object
14
15
16
17
18
|
# File 'lib/shoehorn/helper_collection.rb', line 14
def each
@calls.each do |c|
yield c
end
end
|
#shift ⇒ Object
28
29
30
|
# File 'lib/shoehorn/helper_collection.rb', line 28
def shift
@calls.shift
end
|
#size ⇒ Object
24
25
26
|
# File 'lib/shoehorn/helper_collection.rb', line 24
def size
@calls.size
end
|