aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame_factory.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plum/frame_factory.rb')
-rw-r--r--lib/plum/frame_factory.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/plum/frame_factory.rb b/lib/plum/frame_factory.rb
index b4919e5..886b7f4 100644
--- a/lib/plum/frame_factory.rb
+++ b/lib/plum/frame_factory.rb
@@ -27,7 +27,8 @@ module Plum
# @param ack [Symbol] Pass :ack to create an ACK frame.
# @param args [Hash<Symbol, Integer>] The settings values to send.
def settings(ack = nil, **args)
- payload = args.inject(String.new) {|payload, (key, value)|
+ payload = String.new
+ args.each { |key, value|
id = Frame::SETTINGS_TYPE[key] or raise ArgumentError.new("invalid settings type")
payload.push_uint16(id)
payload.push_uint32(value)