aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2015-10-25 23:44:05 +0900
committerKazuki Yamaguchi <k@rhe.jp>2015-10-25 23:44:05 +0900
commitbaf217cf0ed4eb5990d7823903a152d0c337c377 (patch)
tree2ddf447357d9b106ca7e0a9a3f9e9c2c97e6c599 /lib/plum/frame.rb
parente14480d588bfc6182fab7b9ed7292c317b36a752 (diff)
downloadplum-baf217cf0ed4eb5990d7823903a152d0c337c377.tar.gz
improve docs
Diffstat (limited to 'lib/plum/frame.rb')
-rw-r--r--lib/plum/frame.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/plum/frame.rb b/lib/plum/frame.rb
index 72fc2b9..981bf55 100644
--- a/lib/plum/frame.rb
+++ b/lib/plum/frame.rb
@@ -17,6 +17,8 @@ module Plum
window_update: 0x08,
continuation: 0x09
}.freeze
+
+ # @!visibility private
FRAME_TYPES_INVERSE = FRAME_TYPES.invert.freeze
FRAME_FLAGS = {
@@ -49,6 +51,7 @@ module Plum
}.freeze
}.freeze
+ # @!visibility private
FRAME_FLAGS_MAP = FRAME_FLAGS.values.inject(:merge).freeze
SETTINGS_TYPE = {
@@ -75,9 +78,9 @@ module Plum
attr_accessor :type_value
# [Integer] Flags. 8-bit
attr_accessor :flags_value
- # [Integer] Stream Identifier. unsigned 31-bit integer
+ # [Integer] Stream Identifier. Unsigned 31-bit integer
attr_reader :stream_id
- # [String] The payload.
+ # [String] The payload. Value is frozen.
attr_reader :payload
def initialize(type: nil, type_value: nil, flags: nil, flags_value: nil, stream_id: nil, payload: nil)
@@ -126,7 +129,6 @@ module Plum
end
# Frame#flag_name?() == Frame#flags().include?(:flag_name)
- # TODO
FRAME_FLAGS_MAP.each { |name, value|
class_eval <<-EOS, __FILE__, __LINE__ + 1
def #{name}?
@@ -150,7 +152,6 @@ module Plum
end
# Parses a frame from given buffer. It changes given buffer.
- #
# @param buffer [String] The buffer stored the data received from peer. Encoding must be Encoding::BINARY.
# @return [Frame, nil] The parsed frame or nil if the buffer is imcomplete.
def self.parse!(buffer)