Class: Htcp::Message::Constructor
- Inherits:
-
Object
- Object
- Htcp::Message::Constructor
- Defined in:
- lib/htcp/message/constructor.rb
Instance Method Summary collapse
-
#initialize(params) ⇒ Constructor
constructor
A new instance of Constructor.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ Constructor
Returns a new instance of Constructor.
4 5 6 7 8 |
# File 'lib/htcp/message/constructor.rb', line 4 def initialize(params) @header = Htcp::Message::Header.new(params[:head] || {}) @data = Htcp::Message::Data.new(params[:data] || params) @auth = Htcp::Message::Auth.new(params[:auth] || {}) end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 |
# File 'lib/htcp/message/constructor.rb', line 10 def to_s payload = @data.to_s + @auth.to_s @header.payload_len = payload.length @header.to_s + payload end |