apipie-params 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -3,6 +3,5 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem 'pry'
7
6
  gem 'simplecov'
8
7
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Apipie
2
2
  module Params
3
- VERSION = '0.0.2' unless defined? Apipie::Params::VERSION
3
+ VERSION = '0.0.3' unless defined? Apipie::Params::VERSION
4
4
  end
5
5
  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.2
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-04-25 00:00:00.000000000 Z
12
+ date: 2013-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport