Class: Tep::WebSocket::ParseResult

Inherits:
Object
  • Object
show all
Defined in:
lib/tep/websocket/frame.rb

Overview

ParseResult carries either a parsed frame, a “need more bytes” signal, or a close-code for a protocol violation. Field is named ‘outcome` (not `status`) because attr_accessor :status collides with Tep::Response.status (Integer) under spinel’s same-name-attr unification family (matz/spinel#537 / #538), widening Tep.reason(status) to accept poly and breaking the build.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParseResult

Returns a new instance of ParseResult.



230
231
232
233
234
235
# File 'lib/tep/websocket/frame.rb', line 230

def initialize
  @outcome    = ""
  @frame      = Tep::WebSocket::Frame.new(true, 0, "")
  @consumed   = 0
  @close_code = 0
end

Instance Attribute Details

#close_codeObject

Returns the value of attribute close_code.



228
229
230
# File 'lib/tep/websocket/frame.rb', line 228

def close_code
  @close_code
end

#consumedObject

Returns the value of attribute consumed.



228
229
230
# File 'lib/tep/websocket/frame.rb', line 228

def consumed
  @consumed
end

#frameObject

Returns the value of attribute frame.



228
229
230
# File 'lib/tep/websocket/frame.rb', line 228

def frame
  @frame
end

#outcomeObject

Returns the value of attribute outcome.



228
229
230
# File 'lib/tep/websocket/frame.rb', line 228

def outcome
  @outcome
end