Class: TwilioMock::Testing
- Inherits:
-
Object
- Object
- TwilioMock::Testing
- Defined in:
- lib/twilio_mock/testing.rb
Class Attribute Summary collapse
-
.__test_mode ⇒ Object
Returns the value of attribute __test_mode.
Class Method Summary collapse
- .__set_test_mode(mode) ⇒ Object
- .disable!(&block) ⇒ Object
- .disabled? ⇒ Boolean
- .enable!(&block) ⇒ Object
- .enabled? ⇒ Boolean
Class Attribute Details
.__test_mode ⇒ Object
Returns the value of attribute __test_mode.
4 5 6 |
# File 'lib/twilio_mock/testing.rb', line 4 def __test_mode @__test_mode end |
Class Method Details
.__set_test_mode(mode) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/twilio_mock/testing.rb', line 6 def __set_test_mode(mode) if block_given? current_mode = self.__test_mode begin self.__test_mode = mode yield ensure self.__test_mode = current_mode end else self.__test_mode = mode end end |
.disable!(&block) ⇒ Object
24 25 26 |
# File 'lib/twilio_mock/testing.rb', line 24 def disable!(&block) __set_test_mode(:disable, &block) end |
.disabled? ⇒ Boolean
32 33 34 |
# File 'lib/twilio_mock/testing.rb', line 32 def disabled? self.__test_mode == :disable end |
.enable!(&block) ⇒ Object
20 21 22 |
# File 'lib/twilio_mock/testing.rb', line 20 def enable!(&block) __set_test_mode(:enable, &block) end |
.enabled? ⇒ Boolean
28 29 30 |
# File 'lib/twilio_mock/testing.rb', line 28 def enabled? self.__test_mode == :enable end |