resource-struct 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/resource_struct/flex_struct.rb +10 -5
- data/lib/resource_struct/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81f9dfcc67f4c1670776860dd53c7d0885eb1b1d53ca7b9bae7202c782cbad85
|
4
|
+
data.tar.gz: ae36515a1e79be8653e2b4497dee9ab5f8d522e740cfcafe93681d946a5e528e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835d23cd09aa4a26cce6cf30378e749f5eee0a9439501fd1120ee3ac6f77f6adaed05ea688632e23dce09dd7bee8616859176fbc135b2d027c388aa3eec10e1b
|
7
|
+
data.tar.gz: 102bada15cf4151340c2fd95c5927335e19ec9bd637a2e74ba3b1e2193ead54a3a3a5af8d451caf364f0465caf5663079eeeaf72e3b7c7acc7b1ef7c847e3f95
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -37,12 +37,17 @@ module ResourceStruct
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def method_missing(name, *args)
|
40
|
-
|
41
|
-
|
42
|
-
return !!self[name[...-1]] if name.end_with?("?") && args_length.zero?
|
43
|
-
return self[name[...-1]] = args.first if name.end_with?("=") && args_length == 1
|
40
|
+
if name.end_with?("=")
|
41
|
+
return self[name[...-1]] = args.first if args.length == 1
|
44
42
|
|
45
|
-
|
43
|
+
raise ArgumentError, "expected 1 argument received #{args.length} arguments"
|
44
|
+
elsif name.end_with?("?")
|
45
|
+
return !!self[name[...-1]] if args.empty?
|
46
|
+
elsif args.empty?
|
47
|
+
return self[name]
|
48
|
+
end
|
49
|
+
|
50
|
+
raise ArgumentError, "expected 0 arguments received #{args.length} arguments"
|
46
51
|
end
|
47
52
|
|
48
53
|
def respond_to_missing?(name, include_private = false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resource-struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Riedler
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Openstruct like access without all the headaches of Hash method overrides
|
14
14
|
etc...
|
@@ -41,7 +41,7 @@ metadata:
|
|
41
41
|
homepage_uri: https://github.com/AlexRiedler/resource-struct
|
42
42
|
source_code_uri: https://github.com/AlexRiedler/resource-struct
|
43
43
|
changelog_uri: https://raw.githubusercontent.com/AlexRiedler/resource-struct/master/CHANGELOG.md
|
44
|
-
post_install_message:
|
44
|
+
post_install_message:
|
45
45
|
rdoc_options: []
|
46
46
|
require_paths:
|
47
47
|
- lib
|
@@ -56,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
-
signing_key:
|
59
|
+
rubygems_version: 3.1.6
|
60
|
+
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Ruby structs for resource responses
|
63
63
|
test_files: []
|