Class: LogStash::Modules::KibanaClient::Response
- Inherits:
- 
      Object
      
        - Object
- LogStash::Modules::KibanaClient::Response
 
- Defined in:
- lib/logstash/modules/kibana_client.rb
Instance Attribute Summary collapse
- 
  
    
      #body  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    to create a custom response with body as an Object (Hash or Array). 
- 
  
    
      #headers  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    to create a custom response with body as an Object (Hash or Array). 
- 
  
    
      #status  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    to create a custom response with body as an Object (Hash or Array). 
Instance Method Summary collapse
- #failed? ⇒ Boolean
- 
  
    
      #initialize(status, body, headers = {})  ⇒ Response 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Response. 
- #succeeded? ⇒ Boolean
Constructor Details
#initialize(status, body, headers = {}) ⇒ Response
Returns a new instance of Response.
| 13 14 15 16 | # File 'lib/logstash/modules/kibana_client.rb', line 13 def initialize(status, body, headers={}) @status, @body, @headers = status, body, headers @body = body.is_a?(String) ? LogStash::Json.load(body) : body end | 
Instance Attribute Details
#body ⇒ Object (readonly)
to create a custom response with body as an Object (Hash or Array)
| 12 13 14 | # File 'lib/logstash/modules/kibana_client.rb', line 12 def body @body end | 
#headers ⇒ Object (readonly)
to create a custom response with body as an Object (Hash or Array)
| 12 13 14 | # File 'lib/logstash/modules/kibana_client.rb', line 12 def headers @headers end | 
#status ⇒ Object (readonly)
to create a custom response with body as an Object (Hash or Array)
| 12 13 14 | # File 'lib/logstash/modules/kibana_client.rb', line 12 def status @status end | 
Instance Method Details
#failed? ⇒ Boolean
| 22 23 24 | # File 'lib/logstash/modules/kibana_client.rb', line 22 def failed? !succeeded? end | 
#succeeded? ⇒ Boolean
| 18 19 20 | # File 'lib/logstash/modules/kibana_client.rb', line 18 def succeeded? @status >= 200 && @status < 300 end |