Class: Ronin::Address
Overview
A base model which represents an Internet Address, such as:
Direct Known Subclasses
Class Method Summary collapse
-
.[](key) ⇒ Address?
Finds an address.
-
.parse(address) ⇒ Address
Parses the address.
Instance Method Summary collapse
-
#inspect ⇒ String
Inspects the address.
-
#to_s ⇒ String
Converts the address into a string.
Methods included from Model
Class Method Details
.[](key) ⇒ Address?
Finds an address.
90 91 92 93 94 95 96 |
# File 'lib/ronin/address.rb', line 90 def self.[](key) if key.kind_of?(String) first(:address => key) else super(key) end end |
.parse(address) ⇒ Address
Parses the address.
73 74 75 |
# File 'lib/ronin/address.rb', line 73 def self.parse(address) first_or_new(:address => address) end |
Instance Method Details
#inspect ⇒ String
Inspects the address.
122 123 124 |
# File 'lib/ronin/address.rb', line 122 def inspect "#<#{self.class}: #{self.address}>" end |
#to_s ⇒ String
Converts the address into a string.
108 109 110 |
# File 'lib/ronin/address.rb', line 108 def to_s self.address.to_s end |