hyper-resource 1.0.0.lap89 → 1.0.0.lap90
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/lib/hyper_record/class_methods.rb +5 -5
- data/lib/hyperloop/resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9ed7892a3f12afc18bc72276a2568394c3de5f45f3589ebff8ce40ac6cb8760
|
4
|
+
data.tar.gz: 9dd786986e6db07addc1abced5557a456c3bc8e0da7af0cfa51579c4097df472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483affc6f448b7beac296db929756e0c509d416051114de44fabb14beb125da9806308eb7935feae0c3678c3d8b6df5a35f30daa2e2bf7633c363cd3e09ab3b2
|
7
|
+
data.tar.gz: 4e35303049e626786a20cf8a87f4c4bba2f5e497ff910c631612d598cf2522a1c4a5e8d4afdc4d4cecd933f853d4bb095c4fa62ba041c1d098d5b2b667c6674e
|
@@ -137,7 +137,7 @@ module HyperRecord
|
|
137
137
|
define_method("promise_#{name}") do
|
138
138
|
@fetch_states[name] = 'i'
|
139
139
|
unless @rest_methods.has_key?(name)
|
140
|
-
@rest_methods[name] = options
|
140
|
+
@rest_methods[name] = {}.merge!(options)
|
141
141
|
@rest_methods[name] = { result: options[:default_result] }
|
142
142
|
@update_on_link[name] = {}
|
143
143
|
end
|
@@ -159,7 +159,7 @@ module HyperRecord
|
|
159
159
|
define_method(name) do
|
160
160
|
_register_observer
|
161
161
|
unless @rest_methods.has_key?(name)
|
162
|
-
@rest_methods[name] = options
|
162
|
+
@rest_methods[name] = {}.merge!(options)
|
163
163
|
@rest_methods[name] = { result: options[:default_result] }
|
164
164
|
@update_on_link[name] = {}
|
165
165
|
end
|
@@ -405,7 +405,7 @@ module HyperRecord
|
|
405
405
|
# @param options [Hash] further options for ORMs like Neo4j
|
406
406
|
#
|
407
407
|
# This macro defines additional methods:
|
408
|
-
def has_one(direction, name, options = { type: nil })
|
408
|
+
def has_one(direction, name = nil, options = { type: nil })
|
409
409
|
if name.is_a?(Hash)
|
410
410
|
options.merge(name)
|
411
411
|
name = direction
|
@@ -575,7 +575,7 @@ module HyperRecord
|
|
575
575
|
define_method("promise_#{name}") do |*args|
|
576
576
|
name_args = self.class._name_args(name, *args)
|
577
577
|
@fetch_states[name_args] = 'i'
|
578
|
-
@rest_methods[name] = options unless @rest_methods.has_key?(name)
|
578
|
+
@rest_methods[name] = {}.merge!(options) unless @rest_methods.has_key?(name)
|
579
579
|
@rest_methods[name_args] = { result: options[:default_result] } unless @rest_methods.has_key?(name_args)
|
580
580
|
raise "#{self.class.to_s}[_no_id_].#{name}, can't execute instance rest_method without id!" unless self.id
|
581
581
|
self.class._promise_get_or_patch("#{resource_base_uri}/#{self.id}/methods/#{name}.json?timestamp=#{`Date.now() + Math.random()`}", *args).then do |response_json|
|
@@ -594,7 +594,7 @@ module HyperRecord
|
|
594
594
|
define_method(name) do |*args|
|
595
595
|
_register_observer
|
596
596
|
name_args = self.class._name_args(name, *args)
|
597
|
-
@rest_methods[name] = options unless @rest_methods.has_key?(name)
|
597
|
+
@rest_methods[name] = {}.merge!(options) unless @rest_methods.has_key?(name)
|
598
598
|
@rest_methods[name_args] = { result: options[:default_result] } unless @rest_methods.has_key?(name_args)
|
599
599
|
unless @fetch_states.has_key?(name_args) && 'fi'.include?(@fetch_states[name_args])
|
600
600
|
self.send("promise_#{name}", *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.lap90
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08
|
11
|
+
date: 2018-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|