Class: Htcp::Message::Specifier

Inherits:
Base
  • Object
show all
Defined in:
lib/htcp/message/specifier.rb

Instance Method Summary collapse

Methods inherited from Base

#encode_int16, #encode_int32, #encode_int8, #encode_string

Constructor Details

#initialize(params) ⇒ Specifier

Returns a new instance of Specifier.



4
5
6
# File 'lib/htcp/message/specifier.rb', line 4

def initialize(params)
  @params = params
end

Instance Method Details

#to_sObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/htcp/message/specifier.rb', line 8

def to_s
  request = ''
    
  request << encode_string(@params[:method] || 'GET')
  request << encode_string(@params[:uri])
  request << encode_string(@params[:version] || 'HTTP/1.1')
  request << encode_string(@params[:headers] || '')
    
  return request
end