Class: Riddl::Server::Execution
- Inherits:
-
Object
- Object
- Riddl::Server::Execution
- Defined in:
- lib/ruby/riddl/server.rb
Overview
{{{
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, headers) ⇒ Execution
constructor
A new instance of Execution.
Constructor Details
#initialize(response, headers) ⇒ Execution
Returns a new instance of Execution.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ruby/riddl/server.rb', line 29 def initialize(response,headers) @response = (response.is_a?(Array) ? response.dup : [response]) @headers = (headers.is_a?(Array) ? headers : [headers]) @response.delete_if do |r| r.class != Riddl::Parameter::Simple && r.class != Riddl::Parameter::Complex end @headers.delete_if do |h| h.class != Riddl::Header end @headers.compact! @response.compact! @headers = Hash[ @headers.map{ |h| [h.name, h.value] } ] end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
28 29 30 |
# File 'lib/ruby/riddl/server.rb', line 28 def headers @headers end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
28 29 30 |
# File 'lib/ruby/riddl/server.rb', line 28 def response @response end |