Class: TestFriendlyHelper
- Inherits:
-
Object
- Object
- TestFriendlyHelper
- Defined in:
- lib/test_friendly_helper.rb
Instance Attribute Summary collapse
-
#tagged_callbacks ⇒ Object
Returns the value of attribute tagged_callbacks.
-
#unprocessed_procs ⇒ Object
Returns the value of attribute unprocessed_procs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ TestFriendlyHelper
constructor
A new instance of TestFriendlyHelper.
- #optimize_tagged_callbacks ⇒ Object
Constructor Details
#initialize ⇒ TestFriendlyHelper
Returns a new instance of TestFriendlyHelper.
5 6 7 8 |
# File 'lib/test_friendly_helper.rb', line 5 def initialize @unprocessed_procs = [] @tagged_callbacks = [] end |
Instance Attribute Details
#tagged_callbacks ⇒ Object
Returns the value of attribute tagged_callbacks.
3 4 5 |
# File 'lib/test_friendly_helper.rb', line 3 def tagged_callbacks @tagged_callbacks end |
#unprocessed_procs ⇒ Object
Returns the value of attribute unprocessed_procs.
3 4 5 |
# File 'lib/test_friendly_helper.rb', line 3 def unprocessed_procs @unprocessed_procs end |
Class Method Details
.get_helper_for(tag, type) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/test_friendly_helper.rb', line 15 def self.get_helper_for(tag, type) @helpers ||= {} @helpers[type] ||= {} if !@helpers[type][tag] @helpers[type][tag] = TestFriendlyHelper.new end @helpers[type][tag] end |
Instance Method Details
#optimize_tagged_callbacks ⇒ Object
10 11 12 13 |
# File 'lib/test_friendly_helper.rb', line 10 def optimize_tagged_callbacks @tagged_callbacks.flatten! @tagged_callbacks.uniq! end |