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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c7164e7c8619b9fdec6fcf60570f446f3ae5ff2e7a39fb16470c26bafd6c9ea
4
- data.tar.gz: 9d663f572a93669ed264664906437eaab2c8e161c1f202a4bae587702f44b353
3
+ metadata.gz: 6ad53464a361eeeb5bac077b1e7e997eceae6e70648634ac12d8139f6d3926cc
4
+ data.tar.gz: a7304c1a101ee4b9bfb0dfccc76af2b0d55805bbd856125edf6ee7432e2c0034
5
5
  SHA512:
6
- metadata.gz: c586d38a71f7698d2107ceb946f3804bf9e0e423fe627f4da3bc95881e6692ae017a9fef058da38976b7cbf0923c0d74a8dedf2e7f68f0245ae2b01bc534eb96
7
- data.tar.gz: 8da7f8bc45c03e44ee207d440c3a2d4a5b1218b4d91c88471a33964b88a643948e7d1ecb48b5461d900ef39817e816ac0fa561c77d195d5667892bf264c95d8d
6
+ metadata.gz: ef7e5a987822959b24a9872b76d6728983b7857c4d08339b2b56e6d24ce98b433fc961af0128a4ece3b8af36bb13ebd24570515557a3b6ff7385f4d09318cf72
7
+ data.tar.gz: c43a37df64ea431e77b217803a3b4d86d5e092e01d4bf7d2e6d3347e5631b158ce7167edbbb520cd0418f03200e2ca44a69f618a54cd04a07da4d0d407c88bd1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- replicate-ruby (0.1.0)
4
+ replicate-ruby (0.1.1)
5
5
  addressable
6
6
  faraday (>= 2.0)
7
7
  faraday-retry
@@ -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
- self.assign_attributes = params
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 instance_variables.include? :"@#{method_name}"
20
- instance_variable_get "@#{method_name}"
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 = instance_variables_hash.except("client").map { |attr, value| "#{attr}: #{value.inspect}" }
23
+ fields = data.map { |attr, value| "#{attr}: #{value.inspect}" }
33
24
  string << fields.join(", ") << ">"
34
25
  end
35
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Replicate
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.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-13 00:00:00.000000000 Z
11
+ date: 2022-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday