replicate-ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/replicate/record/base.rb +6 -15
- data/lib/replicate/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: 6ad53464a361eeeb5bac077b1e7e997eceae6e70648634ac12d8139f6d3926cc
|
4
|
+
data.tar.gz: a7304c1a101ee4b9bfb0dfccc76af2b0d55805bbd856125edf6ee7432e2c0034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7e5a987822959b24a9872b76d6728983b7857c4d08339b2b56e6d24ce98b433fc961af0128a4ece3b8af36bb13ebd24570515557a3b6ff7385f4d09318cf72
|
7
|
+
data.tar.gz: c43a37df64ea431e77b217803a3b4d86d5e092e01d4bf7d2e6d3347e5631b158ce7167edbbb520cd0418f03200e2ca44a69f618a54cd04a07da4d0d407c88bd1
|
data/Gemfile.lock
CHANGED
@@ -3,33 +3,24 @@
|
|
3
3
|
module Replicate
|
4
4
|
module Record
|
5
5
|
class Base
|
6
|
+
attr_accessor :data
|
7
|
+
|
6
8
|
def initialize(client, params)
|
7
9
|
@client = client
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
def assign_attributes=(params)
|
12
|
-
params = params.instance_variables_hash if params.is_a?(self.class)
|
13
|
-
params.each do |key, value|
|
14
|
-
instance_variable_set("@#{key}", value)
|
15
|
-
end
|
10
|
+
@data = params
|
16
11
|
end
|
17
12
|
|
18
13
|
def method_missing(method_name, *args, &block)
|
19
|
-
if
|
20
|
-
|
14
|
+
if data.key? method_name.to_s
|
15
|
+
data[method_name.to_s]
|
21
16
|
else
|
22
17
|
super
|
23
18
|
end
|
24
19
|
end
|
25
20
|
|
26
|
-
def instance_variables_hash
|
27
|
-
Hash[instance_variables.map { |name| [name.to_s[1..-1], instance_variable_get(name)] } ]
|
28
|
-
end
|
29
|
-
|
30
21
|
def inspect
|
31
22
|
string = "#<#{self.class.name}:#{object_id} "
|
32
|
-
fields =
|
23
|
+
fields = data.map { |attr, value| "#{attr}: #{value.inspect}" }
|
33
24
|
string << fields.join(", ") << ">"
|
34
25
|
end
|
35
26
|
end
|
data/lib/replicate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replicate-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dreaming Tulpa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|