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.



34
35
36
# File 'lib/jetpants/monkeypatch.rb', line 34

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.



27
28
29
# File 'lib/jetpants/monkeypatch.rb', line 27

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