diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-24 12:05:56 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-24 12:05:56 +0900 |
commit | b80cacbb045361c206afb904f0aad8d96f7bd060 (patch) | |
tree | 554e30141c8b55767a1450449c80f1a58ebf4876 /lib/plum/frame.rb | |
parent | 561fd0ebb696deb0edcd07d0261cd078c4d14e77 (diff) | |
download | plum-b80cacbb045361c206afb904f0aad8d96f7bd060.tar.gz |
use String#bytesize instead of String#size
Diffstat (limited to 'lib/plum/frame.rb')
-rw-r--r-- | lib/plum/frame.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/plum/frame.rb b/lib/plum/frame.rb index 7a17c1b..6d5f718 100644 --- a/lib/plum/frame.rb +++ b/lib/plum/frame.rb @@ -78,7 +78,7 @@ module Plum def initialize(length: nil, type: nil, type_value: nil, flags: nil, flags_value: nil, stream_id: nil, payload: nil) @payload = (payload || "").freeze - @length = length || @payload.size + @length = length || @payload.bytesize @type_value = type_value || FRAME_TYPES[type] or raise ArgumentError.new("type_value or type is necessary") @flags_value = flags_value || (flags && flags.map {|flag| FRAME_FLAGS[type][flag] }.inject(:|)) || 0 @stream_id = stream_id or raise ArgumentError.new("stream_id is necessary") |