class_kit 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/class_kit/attribute_helper.rb +3 -2
- data/lib/class_kit/helper.rb +2 -2
- data/lib/class_kit/version.rb +1 -1
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f63485652f99c982496c9c6700e5396ebf743ef8
|
4
|
+
data.tar.gz: 916278e43a38e63989c426c3e5177650664a288c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ca4b70ac5170bbab15d5ed0759474fc4794d9060964ab3fde6f14c6ba7aae9713bf01ffcd0ecc7a8d43950d57ee4ae98a8c4c390a360e4c298000fd6c26080c
|
7
|
+
data.tar.gz: 78f42842fe99c4bae36377afc738f0039c8364fe1dec569897c6b7b2dc2700a91a0433606e299dd4a75519249f3bb6075487719f7d7fa1b9c84ee8362ff158ae
|
@@ -4,7 +4,7 @@ module ClassKit
|
|
4
4
|
return klass.class_variable_get(:@@class_kit_attributes).freeze
|
5
5
|
end
|
6
6
|
|
7
|
-
def get_attribute(klass
|
7
|
+
def get_attribute(klass: klass, name: name)
|
8
8
|
attribute = get_attributes(klass).detect { |i| i[:name] == name }
|
9
9
|
if attribute == nil
|
10
10
|
raise ClassKit::Exceptions::AttributeNotFoundError.new("Attribute: #{name}, could not be found.")
|
@@ -12,8 +12,9 @@ module ClassKit
|
|
12
12
|
return attribute
|
13
13
|
end
|
14
14
|
|
15
|
-
def get_attribute_type(klass
|
15
|
+
def get_attribute_type(klass: klass,name: name)
|
16
16
|
return get_attribute(klass: klass,name: name)[:type]
|
17
17
|
end
|
18
|
+
|
18
19
|
end
|
19
20
|
end
|
data/lib/class_kit/helper.rb
CHANGED
@@ -32,7 +32,7 @@ module ClassKit
|
|
32
32
|
return @hash_helper.to_hash(object)
|
33
33
|
end
|
34
34
|
|
35
|
-
def from_hash(hash
|
35
|
+
def from_hash(hash: hash, klass: klass)
|
36
36
|
validate_class_kit(klass)
|
37
37
|
hash = @hash_helper.symbolize(hash)
|
38
38
|
entity = klass.new
|
@@ -72,7 +72,7 @@ module ClassKit
|
|
72
72
|
@json_helper.to_json(object)
|
73
73
|
end
|
74
74
|
|
75
|
-
def from_json(json
|
75
|
+
def from_json(json: json, klass: klass)
|
76
76
|
hash = JSON.load(json)
|
77
77
|
return from_hash(hash: hash, klass: klass)
|
78
78
|
end
|
data/lib/class_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: class_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
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
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: hash_kit
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: json_kit
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Toolkit for working with classes
|
@@ -115,17 +115,17 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- lib/class_kit.rb
|
119
118
|
- lib/class_kit/attribute_helper.rb
|
120
119
|
- lib/class_kit/class_methods.rb
|
121
|
-
- lib/class_kit/exceptions.rb
|
122
120
|
- lib/class_kit/exceptions/attribute_not_found_error.rb
|
123
121
|
- lib/class_kit/exceptions/invalid_attribute_value_error.rb
|
124
122
|
- lib/class_kit/exceptions/invalid_class_error.rb
|
125
123
|
- lib/class_kit/exceptions/invalid_parse_value_error.rb
|
124
|
+
- lib/class_kit/exceptions.rb
|
126
125
|
- lib/class_kit/helper.rb
|
127
126
|
- lib/class_kit/value_helper.rb
|
128
127
|
- lib/class_kit/version.rb
|
128
|
+
- lib/class_kit.rb
|
129
129
|
homepage: https://github.com/vaughanbrittonsage/class_kit
|
130
130
|
licenses:
|
131
131
|
- MIT
|
@@ -136,18 +136,19 @@ require_paths:
|
|
136
136
|
- lib
|
137
137
|
required_ruby_version: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
|
-
- -
|
139
|
+
- - '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - '>='
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.0.14.1
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Toolkit for working with classes
|
153
153
|
test_files: []
|
154
|
+
has_rdoc:
|