Class: Groonga::Client::Protocol::GQTP::RawResponse

Inherits:
Object
  • Object
show all
Includes:
ERB::Util
Defined in:
lib/groonga/client/protocol/gqtp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ RawResponse

Returns a new instance of RawResponse.



93
94
95
96
97
98
# File 'lib/groonga/client/protocol/gqtp.rb', line 93

def initialize(command)
  @start_time = Time.now.to_f
  @command = command
  @header = nil
  @body = nil
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



92
93
94
# File 'lib/groonga/client/protocol/gqtp.rb', line 92

def body
  @body
end

#headerObject

Returns the value of attribute header.



91
92
93
# File 'lib/groonga/client/protocol/gqtp.rb', line 91

def header
  @header
end

Instance Method Details

#to_groonga_command_compatible_responseObject



100
101
102
103
104
105
106
107
108
109
# File 'lib/groonga/client/protocol/gqtp.rb', line 100

def to_groonga_command_compatible_response
  case @command.output_type
  when :json
    convert_for_json
  when :xml
    convert_for_xml
  when :none
    @body
  end
end