Class: Gauge::MethodCache Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.add_step(parameterized_step_text, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
39
# File 'lib/method_cache.rb', line 36

def self.add_step(parameterized_step_text, &block)
  @@steps_map[parameterized_step_text] = @@steps_map[parameterized_step_text] || []
  @@steps_map[parameterized_step_text].push(block)
end

.add_step_alias(*step_texts) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
# File 'lib/method_cache.rb', line 57

def self.add_step_alias(*step_texts)
  @@steps_with_aliases.push *step_texts if step_texts.length > 1
end

.add_step_text(parameterized_step_text, step_text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
# File 'lib/method_cache.rb', line 49

def self.add_step_text(parameterized_step_text, step_text)
  @@steps_text_map[parameterized_step_text] = step_text
end

.all_stepsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



69
70
71
# File 'lib/method_cache.rb', line 69

def self.all_steps
  @@steps_text_map.values
end

.clear_hooks(hook) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/method_cache.rb', line 32

def self.clear_hooks(hook)
  self.class_variable_get("@@#{hook}_hooks").clear
end

.get_step(parameterized_step_text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
# File 'lib/method_cache.rb', line 41

def self.get_step(parameterized_step_text)
  @@steps_map[parameterized_step_text][0]
end

.get_step_text(parameterized_step_text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



53
54
55
# File 'lib/method_cache.rb', line 53

def self.get_step_text(parameterized_step_text)
  @@steps_text_map[parameterized_step_text]
end

.get_steps(parameterized_step_text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



45
46
47
# File 'lib/method_cache.rb', line 45

def self.get_steps(parameterized_step_text)
  @@steps_map[parameterized_step_text] || []
end

.has_alias?(step_text) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


61
62
63
# File 'lib/method_cache.rb', line 61

def self.has_alias?(step_text)
  @@steps_with_aliases.include? step_text
end

.is_recoverable?(parameterized_step_text) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


73
74
75
# File 'lib/method_cache.rb', line 73

def self.is_recoverable?(parameterized_step_text)
  @@recoverable_steps.include? parameterized_step_text
end

.set_recoverable(parameterized_step_text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



77
78
79
# File 'lib/method_cache.rb', line 77

def self.set_recoverable(parameterized_step_text)
  @@recoverable_steps.push parameterized_step_text
end

.valid_step?(step) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


65
66
67
# File 'lib/method_cache.rb', line 65

def self.valid_step?(step)
  @@steps_map.has_key? step
end