Class: Rack::API::Response
- Inherits:
- 
      Object
      
        - Object
- Rack::API::Response
 
- Defined in:
- lib/rack/api/response.rb
Instance Attribute Summary collapse
- 
  
    
      #options  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute options. 
Instance Method Summary collapse
- 
  
    
      #initialize(options)  ⇒ Response 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Response. 
- #to_rack ⇒ Object
Constructor Details
#initialize(options) ⇒ Response
Returns a new instance of Response.
| 6 7 8 | # File 'lib/rack/api/response.rb', line 6 def initialize() @options = end | 
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
| 4 5 6 | # File 'lib/rack/api/response.rb', line 4 def @options end | 
Instance Method Details
#to_rack ⇒ Object
| 10 11 12 13 14 15 16 17 18 | # File 'lib/rack/api/response.rb', line 10 def to_rack return .to_rack if .respond_to?(:to_rack) [ .fetch(:status, 403), {"Content-Type" => "text/plain"}.merge(.fetch(:headers, {})), [.fetch(:message, "Forbidden")] ] end |