lite-ruby 1.3.0 → 1.3.1

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: 70999d7bfc996b80f4dfc5911b3eeca10f10219e8c7eeabdcafd18a6a1013621
4
- data.tar.gz: 3697787f3d99687ab0b47fc39308c41637956ffe9b4d4258ce1a46916b90e463
3
+ metadata.gz: 8bbae849a2073a389f4e38ff5e8841d572f305c4bdb6a973595eda419c3638b7
4
+ data.tar.gz: e983d29b4799e2d9c608f680d0dfa93b8f813b9bdaf802860b6a867de4fa4159
5
5
  SHA512:
6
- metadata.gz: 555e3a07381d386ae8a7c3acfb9aecf948d1cf7e733f9f932922ab8967bc4d0c9667728e8049553a0b9e393e25cae09a319c891ee544ffdd856f2fae3d31129c
7
- data.tar.gz: fa78a2576aef3d4111f5cd0134b6311f3a17cea5c72c789df925d37550831e8c3ec7a42e478235823ced8c6389051148036542c47d5d9dfa3804cd9dc72def70
6
+ metadata.gz: 264c6227410b80819e384fc612c4b3bd7802b5b021563c62027feb3901f9d1e023170639516ca0fde18fbda591d49595426b5e46d495c4a72f3d0680053884c8
7
+ data.tar.gz: b64b81b77447af8133eae36c57e3295f0073064e1138ec66380ac43410a9b794a59bffa22d4ef6bd00550adfcb9bd532dfaacea66fb2ad9218a07c7197a469f8
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.1] - 2021-07-19
10
+ ### Removed
11
+ - Struct `[]` and `[]=` existing methods
12
+
9
13
  ## [1.3.0] - 2021-07-19
10
14
  ### Added
11
15
  - Added Ruby 3.0 support
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.3.0)
4
+ lite-ruby (1.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/docs/STRUCT.md CHANGED
@@ -1,30 +1,5 @@
1
1
  # Struct
2
2
 
3
- `[]`
4
- ------
5
- Access a value in the Struct by key, like a Hash.
6
-
7
- ```ruby
8
- person = Struct.new(:name, :age)
9
- person.new('bob', 60)
10
-
11
- person['name'] #=> 'bob'
12
- person['fake'] #=> nil
13
- ```
14
-
15
- `[]=`
16
- ------
17
- Store a value in the Struct by key, like a Hash.
18
-
19
- ```ruby
20
- person = Struct.new(:name, :age)
21
- person.new('bob', 60)
22
-
23
- person['name'] = 'tim'
24
-
25
- person['name'] #=> 'tim'
26
- ```
27
-
28
3
  `attributes`
29
4
  ------
30
5
  Returns the key values of the assigned struct.
@@ -3,20 +3,12 @@
3
3
  if Lite::Ruby.configuration.monkey_patches.include?('struct')
4
4
  class Struct
5
5
 
6
- def [](key)
7
- attributes[key.to_sym]
8
- end
9
-
10
- def []=(key, val)
11
- send("#{key}=", val)
12
- end
13
-
14
6
  def attributes
15
7
  each_pair.with_object({}) { |(key, val), hash| hash[key] = val }
16
8
  end
17
9
 
18
10
  def replace(args)
19
- args.each_pair { |key, val| send("#{key}=", val) }
11
+ args.each_pair { |key, val| self[key] = val }
20
12
  end
21
13
 
22
14
  end
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION = '1.3.0'
6
+ VERSION = '1.3.1'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez