class Array

convenient for SHIORI Response treatment

Public Instance Methods

combined(separator = "\x01") click to toggle source

join \x01 separated value like “arg1\x01arg2\x01arg3” from Array @param [String] separator separator @return [String] combined strings

# File lib/shioruby.rb, line 85
def combined(separator = "\x01")
  self.join(separator)
end
combined2(separator1 = "\x02", separator2 = "\x01") click to toggle source

join \x01, \x02 separated value like “arg1-1\x01arg1-2\x02arg2-1\x01arg2-2” from Array of Array @param [String] separator1 1st level separator @param [String] separator2 2nd level separator @return [String] combined strings

# File lib/shioruby.rb, line 93
def combined2(separator1 = "\x02", separator2 = "\x01")
  self.map {|element| element.join(separator2)}.join(separator1)
end