Module: RTSP::Global
Constant Summary collapse
- DEFAULT_RTSP_PORT =
554
- DEFAULT_VERSION =
'1.0'
Instance Attribute Summary collapse
- #log(message) ⇒ Object
-
#log_level ⇒ Symbol
The Logger method to use for logging all messages.
-
#logger ⇒ Logger
By default, this creates a standard Ruby Logger.
-
#raise_errors ⇒ Object
writeonly
Use to disable the raising of RTSP::Errors.
Instance Method Summary collapse
-
#log? ⇒ Boolean
True if logging is enabled; false if it’s turned off.
-
#raise_errors? ⇒ Boolean
True if set to raise errors; false if not.
-
#reset_config! ⇒ Object
Resets class variables back to defaults.
-
#rtsp_version ⇒ String
The RTSP version.
Instance Attribute Details
#log(message) ⇒ Object
38 39 40 |
# File 'lib/rtsp/global.rb', line 38 def log() logger.send(log_level, ) if log? end |
#log_level ⇒ Symbol
The Logger method to use for logging all messages.
33 34 35 |
# File 'lib/rtsp/global.rb', line 33 def log_level @log_level ||= :debug end |
#logger ⇒ Logger
By default, this creates a standard Ruby Logger. If a different type was passed in via #logger=
, this returns that object.
23 24 25 |
# File 'lib/rtsp/global.rb', line 23 def logger @logger ||= ::Logger.new STDOUT end |
#raise_errors=(value) ⇒ Object (writeonly)
Use to disable the raising of RTSP::Errors.
43 44 45 |
# File 'lib/rtsp/global.rb', line 43 def raise_errors=(value) @raise_errors = value end |
Instance Method Details
#log? ⇒ Boolean
Returns true if logging is enabled; false if it’s turned off.
12 13 14 |
# File 'lib/rtsp/global.rb', line 12 def log? @log != false end |
#raise_errors? ⇒ Boolean
Returns true if set to raise errors; false if not.
46 47 48 |
# File 'lib/rtsp/global.rb', line 46 def raise_errors? @raise_errors != false end |
#reset_config! ⇒ Object
Resets class variables back to defaults.
56 57 58 59 60 61 |
# File 'lib/rtsp/global.rb', line 56 def reset_config! self.log = true self.logger = ::Logger.new STDOUT self.log_level = :debug self.raise_errors = true end |
#rtsp_version ⇒ String
Returns The RTSP version.
51 52 53 |
# File 'lib/rtsp/global.rb', line 51 def rtsp_version @version ||= DEFAULT_VERSION end |