Class: ApiExplorer::RequestProxy
Instance Attribute Summary
Attributes inherited from BaseProxy
#obj
Instance Method Summary
collapse
-
#boolean(name, options = {}, &block) ⇒ Object
-
#desc(description) ⇒ Object
-
#exclude_shared_header(name) ⇒ Object
-
#header(name, options = {}) ⇒ Object
-
#integer(name, options = {}, &block) ⇒ Object
-
#param(name, type = nil, options = {}, &block) ⇒ Object
-
#string(name, options = {}, &block) ⇒ Object
-
#struct(name, options = {}, &block) ⇒ Object
Methods inherited from BaseProxy
#collect, #initialize
Instance Method Details
#boolean(name, options = {}, &block) ⇒ Object
30
31
32
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 30
def boolean(name, options = {}, &block)
param(name, :boolean, options)
end
|
#desc(description) ⇒ Object
7
8
9
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 7
def desc(description)
obj.description = description
end
|
3
4
5
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 3
def (name)
obj. << name
end
|
37
38
39
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 37
def (name, options = {})
obj. << Header.new(name, options)
end
|
#integer(name, options = {}, &block) ⇒ Object
33
34
35
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 33
def integer(name, options = {}, &block)
param(name, :integer, options)
end
|
#param(name, type = nil, options = {}, &block) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 11
def param(name, type = nil, options = {}, &block)
desc = options.fetch(:desc, "")
if type.nil? && block_given?
param = Parameter.new(name, [], desc)
param.type = :hash
proxy = RequestProxy.new(param)
proxy.collect(&block)
obj.params << param
else
obj.params << Parameter.new(name, type, desc)
end
end
|
#string(name, options = {}, &block) ⇒ Object
27
28
29
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 27
def string(name, options = {}, &block)
param(name, :string, options)
end
|
#struct(name, options = {}, &block) ⇒ Object
24
25
26
|
# File 'lib/api_explorer/dsl/request_proxy.rb', line 24
def struct(name, options = {}, &block)
param(name, nil, options, &block)
end
|