playerconnect-wsdsl 0.3.8 → 0.3.9
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 +1 -1
- data/Gemfile.lock +5 -5
- data/VERSION +1 -1
- data/lib/response.rb +12 -4
- data/playerconnect-wsdsl.gemspec +2 -2
- metadata +2 -2
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
GEM
|
2
|
-
remote:
|
2
|
+
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
diff-lcs (1.1.3)
|
5
|
-
git (1.2.
|
5
|
+
git (1.2.6)
|
6
6
|
jeweler (1.6.4)
|
7
7
|
bundler (~> 1.0)
|
8
8
|
git (>= 1.2.5)
|
9
9
|
rake
|
10
|
-
rack (1.
|
10
|
+
rack (1.5.2)
|
11
11
|
rack-test (0.5.7)
|
12
12
|
rack (>= 1.0)
|
13
|
-
rake (
|
13
|
+
rake (10.1.1)
|
14
14
|
rspec (2.7.0)
|
15
15
|
rspec-core (~> 2.7.0)
|
16
16
|
rspec-expectations (~> 2.7.0)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
sinatra (1.2.0)
|
23
23
|
rack (~> 1.1)
|
24
24
|
tilt (>= 1.2.2, < 2.0)
|
25
|
-
tilt (1.
|
25
|
+
tilt (1.4.1)
|
26
26
|
yard (0.7.2)
|
27
27
|
|
28
28
|
PLATFORMS
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.9
|
data/lib/response.rb
CHANGED
@@ -29,7 +29,7 @@ class WSDSL
|
|
29
29
|
# @return [Array<WSDSL::Response::Element>]
|
30
30
|
# @api public
|
31
31
|
def element(opts={})
|
32
|
-
el = Element.new(opts[:name], opts[:type])
|
32
|
+
el = Element.new(opts[:name], opts[:type], opts[:required])
|
33
33
|
yield(el) if block_given?
|
34
34
|
@elements << el
|
35
35
|
end
|
@@ -54,6 +54,9 @@ class WSDSL
|
|
54
54
|
# @api public
|
55
55
|
attr_reader :name
|
56
56
|
|
57
|
+
# @api public
|
58
|
+
attr_reader :required
|
59
|
+
|
57
60
|
# @api public
|
58
61
|
attr_reader :type
|
59
62
|
|
@@ -75,12 +78,13 @@ class WSDSL
|
|
75
78
|
# param [String, Symbol] name The name of the element
|
76
79
|
# param [String, Symbol] type The optional type of the element
|
77
80
|
# @api public
|
78
|
-
def initialize(name, type=nil)
|
81
|
+
def initialize(name, type=nil, required=nil)
|
79
82
|
# sets a documentation placeholder since the response doc is defined at the same time
|
80
83
|
# the response is defined.
|
81
84
|
@doc = Documentation::ElementDoc.new(name)
|
82
85
|
@name = name
|
83
86
|
@type = type
|
87
|
+
@required = !(required==false)
|
84
88
|
@attributes = []
|
85
89
|
@vectors = []
|
86
90
|
# we don't need to initialize the nested elements, by default they should be nil
|
@@ -168,7 +172,7 @@ class WSDSL
|
|
168
172
|
# @return [Array<WSDSL::Response::Element>]
|
169
173
|
# @api public
|
170
174
|
def element(opts={})
|
171
|
-
el = Element.new(opts[:name], opts[:type])
|
175
|
+
el = Element.new(opts[:name], opts[:type], opts[:required])
|
172
176
|
yield(el) if block_given?
|
173
177
|
@elements ||= []
|
174
178
|
@elements << el
|
@@ -233,6 +237,9 @@ class WSDSL
|
|
233
237
|
# @api public
|
234
238
|
attr_reader :obj_type
|
235
239
|
|
240
|
+
# @api public
|
241
|
+
attr_accessor :required
|
242
|
+
|
236
243
|
# @api public
|
237
244
|
attr_accessor :attributes
|
238
245
|
|
@@ -260,6 +267,7 @@ class WSDSL
|
|
260
267
|
def initialize(opts)
|
261
268
|
@name = opts[:name]
|
262
269
|
@obj_type = opts[:type]
|
270
|
+
@required = !(opts[:required] == false)
|
263
271
|
@attributes = []
|
264
272
|
end
|
265
273
|
|
@@ -288,7 +296,7 @@ class WSDSL
|
|
288
296
|
# @return [Array<WSDSL::Response::Element>]
|
289
297
|
# @api public
|
290
298
|
def element(opts={})
|
291
|
-
el = Element.new(opts[:name], opts[:type])
|
299
|
+
el = Element.new(opts[:name], opts[:type], opts[:required])
|
292
300
|
yield(el) if block_given?
|
293
301
|
@elements ||= []
|
294
302
|
@elements << el
|
data/playerconnect-wsdsl.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "playerconnect-wsdsl"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Team SDOD"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2014-02-07"
|
13
13
|
s.description = "A Ruby DSL describing Web Services without implementation details."
|
14
14
|
s.email = "sdod"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playerconnect-wsdsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
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:
|
12
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jeweler
|