Class: Mu::Curl::Verify::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/mu/curl/verify.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Response

Returns a new instance of Response.



49
50
51
52
53
54
55
56
57
# File 'lib/mu/curl/verify.rb', line 49

def initialize json
    rs = Request.parse json['bytes'][1]['data']
    @line = rs[:line]
    _, @status, @message = rs[:line].split(/\s+/, 3)
    @status = @status.to_i
    @content = rs[:content]
    @headers = Hash.new
    rs[:headers].each { |h| @headers[h[:key]] = h[:val] }
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



47
48
49
# File 'lib/mu/curl/verify.rb', line 47

def content
  @content
end

#headersObject (readonly)

Returns the value of attribute headers.



46
47
48
# File 'lib/mu/curl/verify.rb', line 46

def headers
  @headers
end

#lineObject (readonly)

Returns the value of attribute line.



43
44
45
# File 'lib/mu/curl/verify.rb', line 43

def line
  @line
end

#messageObject (readonly)

Returns the value of attribute message.



45
46
47
# File 'lib/mu/curl/verify.rb', line 45

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



44
45
46
# File 'lib/mu/curl/verify.rb', line 44

def status
  @status
end