trophonius 1.0.9 → 1.0.10
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/trophonius_model.rb +1 -1
- data/lib/trophonius_record.rb +4 -4
- 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: 39d58cd73fd9aa4eb16eb71bae7ee950169af5f1d67909d1ad872b1836e21701
|
4
|
+
data.tar.gz: facd02e4e8d4e60953ebb3fc94591ac9e5c67b964c572afa78c5a2e4f19acadc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3068d5fa17f5d8f88baf1a08f4b9e82da6fbc0e9c21ea938c6b6e8b49c93774a3f15c708af6e3a2a7fd413737bed9ae95e1d5c9554daa7a3170e17a37e967b3
|
7
|
+
data.tar.gz: 6bfdb0a45ccca549a011bebb0b0ed738e46f67a6e315f2c79a29cc1348685c91dd83b2212aa75f9486caec9b8d0a2099366486bab6907b64d8fe02f2d2785325
|
data/lib/trophonius_model.rb
CHANGED
@@ -187,7 +187,7 @@ module Trophonius
|
|
187
187
|
# @return [Record] A Record with singleton_methods for the fields where possible
|
188
188
|
def self.build_result(result)
|
189
189
|
hash = Trophonius::Record.new()
|
190
|
-
hash.
|
190
|
+
hash.record_id = result["recordId"]
|
191
191
|
hash.layout_name = layout_name
|
192
192
|
result["fieldData"].keys.each do |key|
|
193
193
|
# unless key[/\s/] || key[/\W/]
|
data/lib/trophonius_record.rb
CHANGED
@@ -6,7 +6,7 @@ module Trophonius
|
|
6
6
|
#
|
7
7
|
# A Record is contained in a RecordSet and has methods to retrieve data from the fields inside the Record-hash
|
8
8
|
class Trophonius::Record < Hash
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :record_id, :layout_name, :modifiable_fields, :modified_fields
|
10
10
|
|
11
11
|
##
|
12
12
|
# Initializes a new Record
|
@@ -26,7 +26,7 @@ module Trophonius
|
|
26
26
|
#
|
27
27
|
# @return [True] if successful
|
28
28
|
def save
|
29
|
-
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{
|
29
|
+
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{record_id}")
|
30
30
|
body = "{\"fieldData\": #{modified_fields.to_json}}"
|
31
31
|
response = Request.make_request(url, "Bearer #{Request.get_token}", 'patch', body)
|
32
32
|
if response['messages'][0]['code'] != '0'
|
@@ -42,7 +42,7 @@ module Trophonius
|
|
42
42
|
#
|
43
43
|
# @return [True] if successful
|
44
44
|
def delete
|
45
|
-
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{
|
45
|
+
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{record_id}")
|
46
46
|
response = Request.make_request(url, "Bearer #{Request.get_token}", 'delete', '{}')
|
47
47
|
if response['messages'][0]['code'] != '0'
|
48
48
|
Error.throw_error(response['messages'][0]['code'])
|
@@ -59,7 +59,7 @@ module Trophonius
|
|
59
59
|
#
|
60
60
|
# @return [True] if successful
|
61
61
|
def update(fieldData)
|
62
|
-
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{
|
62
|
+
url = URI("http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/layouts/#{layout_name}/records/#{record_id}")
|
63
63
|
fieldData.keys.each do |field|
|
64
64
|
modifiable_fields[field] = fieldData[field]
|
65
65
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trophonius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kempen Automatisering
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.7.
|
90
|
+
rubygems_version: 2.7.9
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Link between Ruby (on Rails) and FileMaker.
|