Class: Evil::Client::DSL::Responses

Inherits:
Object
  • Object
show all
Defined in:
lib/evil/client/dsl/responses.rb

Instance Method Summary collapse

Instance Method Details

#response(name, status, **options, &block) ⇒ Object

Add settings shared by several responses

Parameters:

  • name (#to_sym)
  • status (#to_i)
  • options (Hash<Symbol, Object>)
  • block (Proc)


9
10
11
# File 'lib/evil/client/dsl/responses.rb', line 9

def response(name, status, **options, &block)
  @client.send :response, name, status, @options.merge(options), &block
end

#responses(**options, &block) ⇒ Object

Add settings shared by several responses

Parameters:

  • options (Hash<Symbol, Object>)
  • block (Proc)


18
19
20
# File 'lib/evil/client/dsl/responses.rb', line 18

def responses(**options, &block)
  self.class.new(@client, @options.merge(options), &block)
end