Class: TrisulRP::Keys::HostInterface
- Inherits:
-
Object
- Object
- TrisulRP::Keys::HostInterface
- 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/10.
Class Method Details
.invert_xform(dstring) {|ret| ... } ⇒ Object
human string to key
151 152 153 154 155 156 |
# File 'lib/trisulrp/keys.rb', line 151 def self.invert_xform(dstring) parts=dstring.split('_') ret = Host.invert_xform(parts[0]) + "_" + HNumber.invert_xform(4,parts[1]) yield ret if block_given? ret end |
.is_human_form?(patt) ⇒ Boolean
is_human_pattern?
166 167 168 169 |
# File 'lib/trisulrp/keys.rb', line 166 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?
159 160 161 162 163 |
# File 'lib/trisulrp/keys.rb', line 159 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 |