Class: IRC::Modes
- Inherits:
-
ThreadSafeHash
- Object
- Hash
- CaseInsensitiveHash
- ThreadSafeHash
- IRC::Modes
- Defined in:
- lib/failirc/modes.rb
Instance Method Summary collapse
-
#initialize(string = nil) ⇒ Modes
constructor
A new instance of Modes.
- #to_s ⇒ Object
Methods inherited from ThreadSafeHash
Methods inherited from CaseInsensitiveHash
Constructor Details
#initialize(string = nil) ⇒ Modes
Returns a new instance of Modes.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/failirc/modes.rb', line 25 def initialize (string=nil) super() self[:extended] = ThreadSafeHash.new if string string.each_char {|char| @modes[char.to_sym] = true } end end |
Instance Method Details
#to_s ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/failirc/modes.rb', line 37 def to_s result = '+' each_key {|mode| if mode mode = mode.to_s if mode.length == 1 result << mode end end } return result end |