hiiro 0.1.247 → 0.1.248
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 +4 -4
- data/lib/hiiro/any_struct.rb +29 -0
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1d9359776e9e191a52cf66894d68c9479b65ac7ee158d8431827cbb798491c2
|
|
4
|
+
data.tar.gz: aac408e2d02c99e647f83f874f544bdb0faa4cb03f98fa84079c74cb6345ba69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f25d0b437741af5e30d8bc9fb5a366a99f569695d9d251638d17413b08e4be989d159532135b87817b4e490fc9d28add036ac029b88e7cd8b70feeacc562c25c
|
|
7
|
+
data.tar.gz: cb7ce0fe3ebccd1fb8f78ac077f17411e6045f8b64ead13b99efa775dc5577b62cf87b11d24bdcc85cc483bff3385db062b4f0dbe991eb194e66f6e83667f366
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class Hiiro
|
|
2
|
+
module AnyStruct
|
|
3
|
+
attr_reader :_args, :_raw_data
|
|
4
|
+
|
|
5
|
+
def initialize(*args, **raw_data)
|
|
6
|
+
@_args = args
|
|
7
|
+
@_raw_data = raw_data
|
|
8
|
+
|
|
9
|
+
hashes = args.select{|arg| arg.is_a?(Hash) }.each
|
|
10
|
+
init_data(*hashes, raw_data)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private def init_data(*hashes)
|
|
14
|
+
hashes.each do |h|
|
|
15
|
+
h.each do |key, value|
|
|
16
|
+
instance_variable_set(:"@#{key}", value)
|
|
17
|
+
|
|
18
|
+
define_singleton_method(key) do
|
|
19
|
+
instance_variable_get(:"@#{key}")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
define_singleton_method(:"#{key}=") do |val|
|
|
23
|
+
instance_variable_set(:"@#{key}", val)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiiro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.248
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -138,6 +138,7 @@ files:
|
|
|
138
138
|
- h-tmux-plugins.tmux
|
|
139
139
|
- hiiro.gemspec
|
|
140
140
|
- lib/hiiro.rb
|
|
141
|
+
- lib/hiiro/any_struct.rb
|
|
141
142
|
- lib/hiiro/app_files.rb
|
|
142
143
|
- lib/hiiro/bins.rb
|
|
143
144
|
- lib/hiiro/config.rb
|