redsnow 0.3.3 → 0.3.4
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/redsnow/blueprint.rb +19 -15
- data/lib/redsnow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ae40384c372364d7042d35ec7c6db9f81384612
|
4
|
+
data.tar.gz: 2e754e3211ba44c852600cdc38538e34d19dfa37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab52de34dc4c447d8fd15a3a358bc8abf17e7bcbff171c4ab8d4aaf208555443c4ae13ef9f8f6d7ed8303bafc9da48b30ad1cca0829363b72ba1a5910d5c9813
|
7
|
+
data.tar.gz: 2d96052f8cd739d0e2c93992d54796129027739a24073b1d39316626f583026348f538146f02d7783526cf878d7c1d22bfef78bf1879e8b2ba470cfc82fca2ef
|
data/Gemfile.lock
CHANGED
data/lib/redsnow/blueprint.rb
CHANGED
@@ -211,7 +211,6 @@ module RedSnow
|
|
211
211
|
attr_accessor :body
|
212
212
|
attr_accessor :schema
|
213
213
|
attr_accessor :reference
|
214
|
-
attr_reader :example
|
215
214
|
|
216
215
|
# @param sc_payload_handle_resource [FFI::Pointer]
|
217
216
|
def initialize(sc_payload_handle_resource)
|
@@ -239,11 +238,9 @@ module RedSnow
|
|
239
238
|
class TransactionExample < NamedBlueprintNode
|
240
239
|
attr_accessor :requests
|
241
240
|
attr_accessor :responses
|
242
|
-
attr_reader :action
|
243
241
|
|
244
242
|
# @param sc_transaction_example_handle [FFI::Pointer]
|
245
|
-
def initialize(sc_transaction_example_handle
|
246
|
-
@action = action
|
243
|
+
def initialize(sc_transaction_example_handle)
|
247
244
|
@name = RedSnow::Binding.sc_transaction_example_name(sc_transaction_example_handle)
|
248
245
|
@description = RedSnow::Binding.sc_transaction_example_description(sc_transaction_example_handle)
|
249
246
|
|
@@ -258,7 +255,8 @@ module RedSnow
|
|
258
255
|
(0..requests_size).each do |index|
|
259
256
|
sc_payload_handle = RedSnow::Binding.sc_payload_handle(sc_payload_collection_handle_requests, index)
|
260
257
|
@requests << Payload.new(sc_payload_handle).tap do |payload|
|
261
|
-
|
258
|
+
example_instance = self
|
259
|
+
payload.define_singleton_method(:example) { example_instance }
|
262
260
|
end
|
263
261
|
end
|
264
262
|
end
|
@@ -275,7 +273,8 @@ module RedSnow
|
|
275
273
|
(0..responses_size).each do |index|
|
276
274
|
sc_payload_handle = RedSnow::Binding.sc_payload_handle(sc_payload_collection_handle_responses, index)
|
277
275
|
@responses << Payload.new(sc_payload_handle).tap do |payload|
|
278
|
-
|
276
|
+
example_instance = self
|
277
|
+
payload.define_singleton_method(:example) { example_instance }
|
279
278
|
end
|
280
279
|
end
|
281
280
|
end
|
@@ -291,11 +290,9 @@ module RedSnow
|
|
291
290
|
attr_accessor :method
|
292
291
|
attr_accessor :parameters
|
293
292
|
attr_accessor :examples
|
294
|
-
attr_reader :resource
|
295
293
|
|
296
294
|
# @param sc_action_handle [FFI::Pointer]
|
297
|
-
def initialize(sc_action_handle
|
298
|
-
@resource = resource
|
295
|
+
def initialize(sc_action_handle)
|
299
296
|
@name = RedSnow::Binding.sc_action_name(sc_action_handle)
|
300
297
|
@description = RedSnow::Binding.sc_action_description(sc_action_handle)
|
301
298
|
|
@@ -313,7 +310,10 @@ module RedSnow
|
|
313
310
|
|
314
311
|
(0..examples_size).each do |index|
|
315
312
|
sc_transaction_example_handle = RedSnow::Binding.sc_transaction_example_handle(sc_transaction_example_collection_handle, index)
|
316
|
-
@examples << TransactionExample.new(sc_transaction_example_handle
|
313
|
+
@examples << TransactionExample.new(sc_transaction_example_handle).tap do |example|
|
314
|
+
action_instance = self
|
315
|
+
example.define_singleton_method(:action) { action_instance }
|
316
|
+
end
|
317
317
|
end
|
318
318
|
end
|
319
319
|
end
|
@@ -330,11 +330,9 @@ module RedSnow
|
|
330
330
|
attr_accessor :model
|
331
331
|
attr_accessor :parameters
|
332
332
|
attr_accessor :actions
|
333
|
-
attr_reader :resource_group
|
334
333
|
|
335
334
|
# @param sc_resource_handle [FFI::Pointer]
|
336
|
-
def initialize(sc_resource_handle
|
337
|
-
@resource_group = resource_group
|
335
|
+
def initialize(sc_resource_handle)
|
338
336
|
@name = RedSnow::Binding.sc_resource_name(sc_resource_handle)
|
339
337
|
@description = RedSnow::Binding.sc_resource_description(sc_resource_handle)
|
340
338
|
@uri_template = RedSnow::Binding.sc_resource_uritemplate(sc_resource_handle)
|
@@ -354,7 +352,10 @@ module RedSnow
|
|
354
352
|
|
355
353
|
(0..action_size).each do |index|
|
356
354
|
sc_action_handle = RedSnow::Binding.sc_action_handle(sc_action_collection_handle, index)
|
357
|
-
@actions << Action.new(sc_action_handle
|
355
|
+
@actions << Action.new(sc_action_handle).tap do |action|
|
356
|
+
resource_instance = self
|
357
|
+
action.define_singleton_method(:resource) { resource_instance }
|
358
|
+
end
|
358
359
|
end
|
359
360
|
end
|
360
361
|
end
|
@@ -381,7 +382,10 @@ module RedSnow
|
|
381
382
|
|
382
383
|
(0..resource_size).each do |index|
|
383
384
|
sc_resource_handle = RedSnow::Binding.sc_resource_handle(sc_resource_collection_handle, index)
|
384
|
-
@resources << Resource.new(sc_resource_handle
|
385
|
+
@resources << Resource.new(sc_resource_handle).tap do |resource|
|
386
|
+
resource_group_instance = self
|
387
|
+
resource.define_singleton_method(:resource_group) { resource_group_instance }
|
388
|
+
end
|
385
389
|
end
|
386
390
|
end
|
387
391
|
end
|
data/lib/redsnow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redsnow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ladislav Prskavec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|