Module: Kosmonaut

Extended by:
Kosmonaut
Included in:
Kosmonaut
Defined in:
lib/kosmonaut/errors.rb,
lib/kosmonaut.rb,
lib/kosmonaut/client.rb,
lib/kosmonaut/socket.rb,
lib/kosmonaut/worker.rb,
lib/kosmonaut/version.rb

Overview

Copyright © 2012 Krzysztof Kowalik <[email protected]> and folks at Cubox

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Version Classes: BadRequestError, ChannelNotFoundError, Client, EndOfFileError, Error, ForbiddenError, InternalError, InvalidChannelNameError, Socket, UnauthorizedError, UnknownServerError, Worker

Constant Summary collapse

ERRORS =
{
  400 => BadRequestError,
  402 => UnauthorizedError,
  403 => ForbiddenError,
  451 => InvalidChannelNameError,
  454 => ChannelNotFoundError,
  597 => InternalError,
  598 => EndOfFileError,
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#debugObject

Public: The debug mode switch. If true, then debug messages will be printed out.



22
23
24
# File 'lib/kosmonaut.rb', line 22

def debug
  @debug
end

Class Method Details

.versionObject



22
23
24
# File 'lib/kosmonaut/version.rb', line 22

def self.version
  Version.to_s
end

Instance Method Details

#log(msg) ⇒ Object

Internal: Simple logging method used to display debug information

msg - The debug message to be displayed



28
29
30
# File 'lib/kosmonaut.rb', line 28

def log(msg)
  print("DEBUG: ", msg, "\n") if Kosmonaut.debug
end