proxima 0.3.1 → 0.3.2
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/proxima/version.rb +1 -1
- data/lib/proxima.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c71acef7a7a680c478bf0e074442f7eea364839f
|
4
|
+
data.tar.gz: b32348b4e032e8d6fdb0c5bfa0aa28c3cacb62a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fba6e6552f8864f28ef2f1e37a8e3009a4fe326cd94eca4173554c6030e43f9bc0571ea54994bfdd5a690414a70b2ce81d42714dcc2b3fff20feaa098e75302b
|
7
|
+
data.tar.gz: 4838de09244d31c6256a1a55eabe70984da12968e27c356638b5e810a45ecb040ee3966ead87da6b010b12d35578adff09342b29b8cf1c28351e54973333e64e
|
data/lib/proxima/version.rb
CHANGED
data/lib/proxima.rb
CHANGED
@@ -5,7 +5,7 @@ require "proxima/model"
|
|
5
5
|
|
6
6
|
module Proxima
|
7
7
|
|
8
|
-
|
8
|
+
TYPES = [
|
9
9
|
{
|
10
10
|
klass: String,
|
11
11
|
from_json: -> v { v.to_s },
|
@@ -46,7 +46,7 @@ module Proxima
|
|
46
46
|
]
|
47
47
|
|
48
48
|
def self.add_type(klass, from = nil, to = nil)
|
49
|
-
|
49
|
+
TYPES.push({
|
50
50
|
klass: klass,
|
51
51
|
from: from,
|
52
52
|
to: to
|
@@ -54,7 +54,7 @@ module Proxima
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.remove_type(klass)
|
57
|
-
|
57
|
+
TYPES.delete_if({
|
58
58
|
klass: klass,
|
59
59
|
from: from,
|
60
60
|
to: to
|
@@ -62,12 +62,12 @@ module Proxima
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def self.type_from_json(klass, value)
|
65
|
-
type =
|
65
|
+
type = TYPES.find { |t| t[:klass] == klass }
|
66
66
|
type.from_json(value) if type else value
|
67
67
|
end
|
68
68
|
|
69
69
|
def self.type_to_json(klass, value)
|
70
|
-
type =
|
70
|
+
type = TYPES.find { |t| t[:klass] == klass }
|
71
71
|
type.to_json(value) if type else value
|
72
72
|
end
|
73
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxima
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Hurst
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|