Class: Respect::Rails::RequestDef

Inherits:
Object
  • Object
show all
Defined in:
lib/respect/rails/request_def.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (RequestDef) initialize(*args)

A new instance of RequestDef



11
12
13
# File 'lib/respect/rails/request_def.rb', line 11

def initialize(*args)
  @request_schema = RequestSchema.new(*args)
end

Class Method Details

+ (Object) eval(*args, &block)



6
7
8
# File 'lib/respect/rails/request_def.rb', line 6

def eval(*args, &block)
  new(*args).eval(&block)
end

Instance Method Details

- (Object) body_parameters(&block)



24
25
26
# File 'lib/respect/rails/request_def.rb', line 24

def body_parameters(&block)
  @request_schema.body_parameters = HashSchema.define(&block)
end

- (Object) eval(&block)



15
16
17
18
# File 'lib/respect/rails/request_def.rb', line 15

def eval(&block)
  block.call(self)
  @request_schema
end

- (Object) headers(&block)



32
33
34
# File 'lib/respect/rails/request_def.rb', line 32

def headers(&block)
  @request_schema.headers = HashSchema.define(&block)
end

- (Object) path_parameters(&block)



20
21
22
# File 'lib/respect/rails/request_def.rb', line 20

def path_parameters(&block)
  @request_schema.path_parameters = HashSchema.define(&block)
end

- (Object) query_parameters(&block)



28
29
30
# File 'lib/respect/rails/request_def.rb', line 28

def query_parameters(&block)
  @request_schema.query_parameters = HashSchema.define(&block)
end