Class: Ruckus::Selector

Inherits:
String show all
Defined in:
lib/ruckus/selector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rclassObject (readonly)

Returns the value of attribute rclass.



4
5
6
# File 'lib/ruckus/selector.rb', line 4

def rclass
  @rclass
end

#ridObject (readonly)

Returns the value of attribute rid.



3
4
5
# File 'lib/ruckus/selector.rb', line 3

def rid
  @rid
end

#rkindObject (readonly)

Returns the value of attribute rkind.



5
6
7
# File 'lib/ruckus/selector.rb', line 5

def rkind
  @rkind
end