Class: Object

Inherits:
BasicObject
Defined in:
lib/jetpants/monkeypatch.rb

Overview

Add Jetpants-specific conversion methods to Object.

Instance Method Summary collapse

Instance Method Details

#to_dbObject

Converts self to a Jetpants::DB by way of to_s. Only really useful for Strings containing IP addresses, or Objects whose to_string method returns an IP address as a string.



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

def to_db
  Jetpants::DB.new(self.to_s)
end

#to_hostObject

Converts self to a Jetpants::Host by way of to_s. Only really useful for Strings containing IP addresses, or Objects whose to_string method returns an IP address as a string.



62
63
64
# File 'lib/jetpants/monkeypatch.rb', line 62

def to_host
  Jetpants::Host.new(self.to_s)
end