Class: TestFriendlyHelper

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestFriendlyHelper

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_callbacksObject

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_procsObject

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_callbacksObject



10
11
12
13
# File 'lib/test_friendly_helper.rb', line 10

def optimize_tagged_callbacks
  @tagged_callbacks.flatten!
  @tagged_callbacks.uniq!
end