apipie-params 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -1
- data/lib/apipie/params/dsl.rb +5 -1
- data/lib/apipie/params/version.rb +1 -1
- metadata +2 -2
data/Gemfile
CHANGED
data/lib/apipie/params/dsl.rb
CHANGED
@@ -14,7 +14,7 @@ module Apipie
|
|
14
14
|
# Example:
|
15
15
|
# param :greeting, String, :desc => "arbitrary text", :required => true
|
16
16
|
#
|
17
|
-
def param(param_name, descriptor_arg, desc_or_options = nil, options = {}, &block) #:doc:
|
17
|
+
def param(param_name, descriptor_arg = nil, desc_or_options = nil, options = {}, &block) #:doc:
|
18
18
|
if desc_or_options.is_a? String
|
19
19
|
options = options.merge(:desc => desc_or_options)
|
20
20
|
end
|
@@ -28,8 +28,12 @@ module Apipie
|
|
28
28
|
# something that has it in :descriptor method
|
29
29
|
def array_of(descriptor)
|
30
30
|
descriptor = if descriptor.is_a? Descriptor::Base
|
31
|
+
descriptor
|
31
32
|
elsif descriptor.respond_to?(:descriptor)
|
32
33
|
descriptor.descriptor
|
34
|
+
else
|
35
|
+
raise ArgumentError,
|
36
|
+
"descriptor is not a Descriptor::Base or an Object with #descriptor method"
|
33
37
|
end
|
34
38
|
Descriptor::Array.new(descriptor, {})
|
35
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|