Class: TrisulRP::Keys::Subnet
- Inherits:
-
Object
- Object
- TrisulRP::Keys::Subnet
- Defined in:
- lib/trisulrp/keys.rb
Class Method Summary collapse
-
.invert_xform(dstring) {|ret| ... } ⇒ Object
human string to key.
-
.is_human_form?(patt) ⇒ Boolean
is_human_pattern?.
-
.is_key_form?(patt) ⇒ Boolean
is_key_pattern?.
-
.xform(kstring) {|ret| ... } ⇒ Object
key to human string => key - 00.00.00.00_8888.
Class Method Details
.invert_xform(dstring) {|ret| ... } ⇒ Object
human string to key
118 119 120 121 122 123 |
# File 'lib/trisulrp/keys.rb', line 118 def self.invert_xform(dstring) parts=dstring.split('/') ret = Host.invert_xform(parts[0]) + "/" + HNumber.invert_xform(2,parts[1]) yield ret if block_given? ret end |
.is_human_form?(patt) ⇒ Boolean
is_human_pattern?
133 134 135 136 |
# File 'lib/trisulrp/keys.rb', line 133 def self.is_human_form? patt parts = patt.split('/') parts.size == 2 and Host.is_human_form?(parts[0]) and HNumber.is_human_form?(parts[1]) end |
.is_key_form?(patt) ⇒ Boolean
is_key_pattern?
126 127 128 129 130 |
# File 'lib/trisulrp/keys.rb', line 126 def self.is_key_form? patt return false if patt.nil? parts = patt.split('/') parts.size == 2 and Host.is_key_form?(parts[0]) and HNumber.is_key_form?(parts[1]) end |