Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/weechat/rubyext/array.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_weechat_config(v) ⇒ Object



2
3
4
# File 'lib/weechat/rubyext/array.rb', line 2

def self.from_weechat_config(v)
  v.escaped_split(",")
end

Instance Method Details

#to_weechat_configObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/weechat/rubyext/array.rb', line 6

def to_weechat_config
  map {|entry|
    case entry
    when String
      entry.gsub(/(\\+)?,/) {|m|
        if $1.nil?
          "\\,"
        else
          $1 + $1 + "\\,"
        end
      }
    else
      entry.to_weechat_config
    end
  }.join(",")
end