Module: Rumai::IXP::Struct::Field::CounterField

Defined in:
lib/rumai/ixp/message.rb

Overview

Methods for a field that counts the length of another field.

Instance Method Summary collapse

Instance Method Details

#to_9p(field_values) ⇒ Object



230
231
232
233
234
235
236
237
238
# File 'lib/rumai/ixp/message.rb', line 230

def to_9p field_values
  value = field_values[@countee.name]
  count =
    case value
    when String then value.bytesize
    else value.length
    end
  value_to_9p count
end