uinit-structure 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c15895eb9482a3f6f4da9fd7e32cf7faa7b00e8dcc313a88526a1be679532eb2
|
4
|
+
data.tar.gz: 4fb76f7c50604b5f1cbd2ff0d245f1586b4e30376f15db6c685e8bea9f427e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786b0bd30d8855c54271a5a5260459182a5c25a9fe878be6dcc6676822e372eb655980c86a545c5343f736906dc084d9ba11e52ddeee397c4459d65d47aac8e0
|
7
|
+
data.tar.gz: 950e1d19b84cdb1101285190c574feb1015fb3b7e9852b6da26bc65e9229272cbc51bbca20f5e2450b51ed72d84ef0ea2cc8bb61410e92cb49822197dd16e096
|
@@ -6,13 +6,6 @@ module Uinit
|
|
6
6
|
include Memoizable
|
7
7
|
include Type::Context
|
8
8
|
|
9
|
-
def self.scope(&)
|
10
|
-
context = Class.new { include AttributeContext }.new
|
11
|
-
context.instance_eval(&)
|
12
|
-
|
13
|
-
context.attributes
|
14
|
-
end
|
15
|
-
|
16
9
|
memo def attributes = []
|
17
10
|
|
18
11
|
def defaults(**defaults)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Uinit
|
4
|
+
module Structure
|
5
|
+
class AttributeScope
|
6
|
+
include AttributeContext
|
7
|
+
|
8
|
+
def initialize(context)
|
9
|
+
self.context = context
|
10
|
+
end
|
11
|
+
|
12
|
+
def scope(&scope)
|
13
|
+
instance_eval(&scope) if scope
|
14
|
+
|
15
|
+
self
|
16
|
+
end
|
17
|
+
|
18
|
+
def method_missing(name, ...)
|
19
|
+
context.send(name, ...)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
attr_accessor :context
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/uinit/structure.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uinit-structure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kimoja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- lib/uinit/structure/attribute_builder.rb
|
82
82
|
- lib/uinit/structure/attribute_context.rb
|
83
83
|
- lib/uinit/structure/attribute_error.rb
|
84
|
+
- lib/uinit/structure/attribute_scope.rb
|
84
85
|
- lib/uinit/structure/attribute_type_error.rb
|
85
86
|
- lib/uinit/structure/compilers/as_json.rb
|
86
87
|
- lib/uinit/structure/compilers/attribute.rb
|