Class: Ruckus::Selector
Instance Attribute Summary collapse
-
#rclass ⇒ Object
readonly
Returns the value of attribute rclass.
-
#rid ⇒ Object
readonly
Returns the value of attribute rid.
-
#rkind ⇒ Object
readonly
Returns the value of attribute rkind.
Instance Method Summary collapse
-
#initialize(s) ⇒ Selector
constructor
A new instance of Selector.
Methods included from String::StringExtensions
#adler, #asciiz, #class_name, #dehexify, #dehexify!, #ends_with?, #entropy, #from_utf16, #from_utf16_buffer, #hexdump, #hexify, #hexify!, #method_name, #nextstring, #or, #pad, #rotate_bytes, #shift, #shift_b16, #shift_b32, #shift_l16, #shift_l32, #shift_tok, #shift_u8, #starts_with?, #strings, #to_b16, #to_b32, #to_l16, #to_l32, #to_u8, #to_utf16, #underscore, #xor, #xor!
Constructor Details
#initialize(s) ⇒ Selector
Returns a new instance of Selector.
7 8 9 10 11 12 13 14 15 |
# File 'lib/ruckus/selector.rb', line 7 def initialize(s) if s =~ /(?:([^.#]+))?(?:\.([^.#]+))?(?:#(.+))?/ @rkind, @rclass, @rid = [$1, $2, $3] else @rkind, @rclass, @rid = [nil, nil, s] end super end |
Instance Attribute Details
#rclass ⇒ Object (readonly)
Returns the value of attribute rclass.
4 5 6 |
# File 'lib/ruckus/selector.rb', line 4 def rclass @rclass end |
#rid ⇒ Object (readonly)
Returns the value of attribute rid.
3 4 5 |
# File 'lib/ruckus/selector.rb', line 3 def rid @rid end |
#rkind ⇒ Object (readonly)
Returns the value of attribute rkind.
5 6 7 |
# File 'lib/ruckus/selector.rb', line 5 def rkind @rkind end |