Method: Rex::Struct2::SStruct#to_s

Defined in:
lib/rex/struct2/s_struct.rb

#to_sObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rex/struct2/s_struct.rb', line 43

def to_s
  # !!! what do we do on mix restraint issues? just fail?
  # maybe throw an exception, because that is most likely
  # a usage error

  buff = ""
  elements.each do |e|
    buff << e.to_s
  end

  if restraint && restraint.max
    return buff.slice(0, restraint.max)
  else
    return buff
  end
end