mihari 5.2.2 → 5.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,16 +13,18 @@ module Mihari
13
13
  attributes[:url]
14
14
  end
15
15
 
16
- #
17
- # @param [Hash] d
18
- #
19
- # @return [ContextAttributes]
20
- #
21
- def self.from_dynamic!(d)
22
- d = Types::Hash[d]
23
- new(
24
- url: d["url"]
25
- )
16
+ class << self
17
+ #
18
+ # @param [Hash] d
19
+ #
20
+ # @return [ContextAttributes]
21
+ #
22
+ def from_dynamic!(d)
23
+ d = Types::Hash[d]
24
+ new(
25
+ url: d["url"]
26
+ )
27
+ end
26
28
  end
27
29
  end
28
30
 
@@ -83,25 +85,27 @@ module Mihari
83
85
  Artifact.new(data: value, metadata: metadata)
84
86
  end
85
87
 
86
- #
87
- # @param [Hash] d
88
- #
89
- # @return [Datum]
90
- #
91
- def self.from_dynamic!(d)
92
- d = Types::Hash[d]
93
-
94
- context_attributes = nil
95
- if d.key?("context_attributes")
96
- context_attributes = ContextAttributes.from_dynamic!(d.fetch("context_attributes"))
88
+ class << self
89
+ #
90
+ # @param [Hash] d
91
+ #
92
+ # @return [Datum]
93
+ #
94
+ def from_dynamic!(d)
95
+ d = Types::Hash[d]
96
+
97
+ context_attributes = nil
98
+ if d.key?("context_attributes")
99
+ context_attributes = ContextAttributes.from_dynamic!(d.fetch("context_attributes"))
100
+ end
101
+
102
+ new(
103
+ type: d.fetch("type"),
104
+ id: d.fetch("id"),
105
+ context_attributes: context_attributes,
106
+ metadata: d
107
+ )
97
108
  end
98
-
99
- new(
100
- type: d.fetch("type"),
101
- id: d.fetch("id"),
102
- context_attributes: context_attributes,
103
- metadata: d
104
- )
105
109
  end
106
110
  end
107
111
 
@@ -115,16 +119,18 @@ module Mihari
115
119
  attributes[:cursor]
116
120
  end
117
121
 
118
- #
119
- # @param [Hash] d
120
- #
121
- # @return [Meta]
122
- #
123
- def self.from_dynamic!(d)
124
- d = Types::Hash[d]
125
- new(
126
- cursor: d["cursor"]
127
- )
122
+ class << self
123
+ #
124
+ # @param [Hash] d
125
+ #
126
+ # @return [Meta]
127
+ #
128
+ def from_dynamic!(d)
129
+ d = Types::Hash[d]
130
+ new(
131
+ cursor: d["cursor"]
132
+ )
133
+ end
128
134
  end
129
135
  end
130
136
 
@@ -153,17 +159,19 @@ module Mihari
153
159
  data.map(&:to_artifact)
154
160
  end
155
161
 
156
- #
157
- # @param [Hash] d
158
- #
159
- # @return [Response]
160
- #
161
- def self.from_dynamic!(d)
162
- d = Types::Hash[d]
163
- new(
164
- meta: Meta.from_dynamic!(d.fetch("meta")),
165
- data: d.fetch("data").map { |x| Datum.from_dynamic!(x) }
166
- )
162
+ class << self
163
+ #
164
+ # @param [Hash] d
165
+ #
166
+ # @return [Response]
167
+ #
168
+ def from_dynamic!(d)
169
+ d = Types::Hash[d]
170
+ new(
171
+ meta: Meta.from_dynamic!(d.fetch("meta")),
172
+ data: d.fetch("data").map { |x| Datum.from_dynamic!(x) }
173
+ )
174
+ end
167
175
  end
168
176
  end
169
177
  end
@@ -67,14 +67,16 @@ module Mihari
67
67
  type
68
68
  end
69
69
 
70
- # @return [String, nil]
71
- def self.type(data)
72
- new(data).type
73
- end
74
-
75
- # @return [String, nil]
76
- def self.detailed_type(data)
77
- new(data).detailed_type
70
+ class << self
71
+ # @return [String, nil]
72
+ def type(data)
73
+ new(data).type
74
+ end
75
+
76
+ # @return [String, nil]
77
+ def detailed_type(data)
78
+ new(data).detailed_type
79
+ end
78
80
  end
79
81
 
80
82
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "5.2.2"
4
+ VERSION = "5.2.3"
5
5
  end
data/mihari.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
 
35
35
  spec.add_development_dependency "bundler", "~> 2.4"
36
36
  spec.add_development_dependency "coveralls_reborn", "~> 0.27"
37
- spec.add_development_dependency "fakefs", "~> 2.4"
37
+ spec.add_development_dependency "fakefs", "~> 2.5"
38
38
  spec.add_development_dependency "fuubar", "~> 2.5"
39
39
  spec.add_development_dependency "mysql2", "~> 0.5"
40
40
  spec.add_development_dependency "pg", "~> 1.5"
@@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
56
56
  spec.add_development_dependency "steep", "~> 1.4"
57
57
  end
58
58
 
59
- spec.add_dependency "activerecord", "7.0.4.3"
59
+ spec.add_dependency "activerecord", "7.0.5"
60
60
  spec.add_dependency "addressable", "2.8.4"
61
61
  spec.add_dependency "awrence", "2.0.1"
62
62
  spec.add_dependency "dotenv", "2.8.1"
@@ -70,7 +70,7 @@ Gem::Specification.new do |spec|
70
70
  spec.add_dependency "email_address", "0.2.4"
71
71
  spec.add_dependency "grape", "1.7.0"
72
72
  spec.add_dependency "grape-entity", "1.0.0"
73
- spec.add_dependency "grape-swagger", "1.6.0"
73
+ spec.add_dependency "grape-swagger", "1.6.1"
74
74
  spec.add_dependency "grape-swagger-entity", "0.5.1"
75
75
  spec.add_dependency "insensitive_hash", "0.3.3"
76
76
  spec.add_dependency "jr-cli", "0.6.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.2
4
+ version: 5.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-20 00:00:00.000000000 Z
11
+ date: 2023-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.4'
47
+ version: '2.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.4'
54
+ version: '2.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fuubar
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -296,14 +296,14 @@ dependencies:
296
296
  requirements:
297
297
  - - '='
298
298
  - !ruby/object:Gem::Version
299
- version: 7.0.4.3
299
+ version: 7.0.5
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - '='
305
305
  - !ruby/object:Gem::Version
306
- version: 7.0.4.3
306
+ version: 7.0.5
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: addressable
309
309
  requirement: !ruby/object:Gem::Requirement
@@ -492,14 +492,14 @@ dependencies:
492
492
  requirements:
493
493
  - - '='
494
494
  - !ruby/object:Gem::Version
495
- version: 1.6.0
495
+ version: 1.6.1
496
496
  type: :runtime
497
497
  prerelease: false
498
498
  version_requirements: !ruby/object:Gem::Requirement
499
499
  requirements:
500
500
  - - '='
501
501
  - !ruby/object:Gem::Version
502
- version: 1.6.0
502
+ version: 1.6.1
503
503
  - !ruby/object:Gem::Dependency
504
504
  name: grape-swagger-entity
505
505
  requirement: !ruby/object:Gem::Requirement