x_runtime 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -1,4 +1,22 @@
1
1
  module XRuntime
2
2
  module Utils
3
+ class << self
4
+ def to_hash(data)
5
+ case data
6
+ when Array
7
+ array_hashify.call(data)
8
+ end
9
+ end
10
+
11
+ def array_hashify
12
+ lambda { |array|
13
+ hash = Hash.new
14
+ array.each_slice(2) do |field, value|
15
+ hash[field] = value
16
+ end
17
+ hash
18
+ }
19
+ end
20
+ end
3
21
  end
4
22
  end
data/x_runtime.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "x_runtime"
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["\u{5d14}\u{5ce5}"]
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  "Rakefile",
25
25
  "VERSION",
26
26
  "lib/x_runtime.rb",
27
- "lib/x_runtime/array.rb",
28
27
  "lib/x_runtime/data_set.rb",
29
28
  "lib/x_runtime/middleware.rb",
30
29
  "lib/x_runtime/portal.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x_runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -91,7 +91,6 @@ files:
91
91
  - Rakefile
92
92
  - VERSION
93
93
  - lib/x_runtime.rb
94
- - lib/x_runtime/array.rb
95
94
  - lib/x_runtime/data_set.rb
96
95
  - lib/x_runtime/middleware.rb
97
96
  - lib/x_runtime/portal.rb
@@ -120,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
119
  version: '0'
121
120
  segments:
122
121
  - 0
123
- hash: -1959727388660971021
122
+ hash: 2732409138093527781
124
123
  required_rubygems_version: !ruby/object:Gem::Requirement
125
124
  none: false
126
125
  requirements:
@@ -1,15 +0,0 @@
1
- class Array
2
- def to_hash
3
- _hashify.call(self)
4
- end
5
-
6
- def _hashify
7
- lambda { |array|
8
- hash = Hash.new
9
- array.each_slice(2) do |field, value|
10
- hash[field] = value
11
- end
12
- hash
13
- }
14
- end
15
- end