dimensional-enum 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimensional/enum/attribute.rb +7 -0
- data/lib/dimensional/enum/version.rb +1 -1
- data/spec/attribute_spec.rb +14 -0
- data/spec/support/sample.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ac66a3936bee1e52633b578ceb12f0495b42b83
|
4
|
+
data.tar.gz: 5caf8bd27ed3cd1ddad59d465f41c6a15499f74f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d338e8df12222577fe07ca8f209bdd0e3798213d5d9ec2a3d12af35d2df34932d77514dda119f24e31df5f503e80bd9f669e6fdc7bbeaf407a5020f4e4ab35bb
|
7
|
+
data.tar.gz: 31b9b10075b9864a32db24bed39174d03e0336cb76d2fcfc0d084130803524d86d509b9171988badc5d381382e91818b4ee27357dd9805720560c23e1485aaf5
|
data/spec/attribute_spec.rb
CHANGED
@@ -15,12 +15,26 @@ module Dimensional::Enum
|
|
15
15
|
expect( enum_attribute.id ).to eq 4
|
16
16
|
end
|
17
17
|
|
18
|
+
it "#value" do
|
19
|
+
enum_attributes = Attributes.new Sample::ENUM_ATTRIBUTES[:core]
|
20
|
+
enum_attribute = Attribute.new "sale_on_nego", enum_attributes.to_attribute_h(:sale_state)
|
21
|
+
expect( enum_attribute.value ).to eq 4
|
22
|
+
end
|
23
|
+
|
18
24
|
it "#name" do
|
19
25
|
enum_attributes = Attributes.new Sample::ENUM_ATTRIBUTES[:core]
|
20
26
|
enum_attribute = Attribute.new "sale_on_nego", enum_attributes.to_attribute_h(:sale_state)
|
21
27
|
expect( enum_attribute.name ).to eq "商談中"
|
22
28
|
end
|
23
29
|
|
30
|
+
it "#number" do
|
31
|
+
enum_attributes = Attributes.new Sample::ENUM_ATTRIBUTES[:core]
|
32
|
+
enum_attribute = Attribute.new "sale_on_nego", enum_attributes.to_attribute_h(:sale_state)
|
33
|
+
expect( enum_attribute.number ).to eq 400
|
34
|
+
enum_attribute = Attribute.new "sale_nego_completed", enum_attributes.to_attribute_h(:sale_state)
|
35
|
+
expect( enum_attribute.number ).to eq nil
|
36
|
+
end
|
37
|
+
|
24
38
|
it "#label" do
|
25
39
|
enum_attributes = Attributes.new Sample::ENUM_ATTRIBUTES[:core]
|
26
40
|
enum_attribute = Attribute.new "sale_on_nego", enum_attributes.to_attribute_h(:sale_state)
|
data/spec/support/sample.rb
CHANGED
@@ -5,11 +5,11 @@ module Sample
|
|
5
5
|
# ---------------------------
|
6
6
|
core: {
|
7
7
|
sale_state: {
|
8
|
-
sale_planned: { id: 1, name: '売り出し見込み' },
|
9
|
-
sale_running: { id: 2, name: '売り出し中' },
|
10
|
-
sale_stopped: { id: 3, name: '売り止め' },
|
11
|
-
sale_on_nego: { id: 4, name: '商談中' },
|
12
|
-
sale_nego_completed: { id: 5, name: '成約済み' }
|
8
|
+
sale_planned: { id: 1, name: '売り出し見込み', number: 100 },
|
9
|
+
sale_running: { id: 2, name: '売り出し中', number: 200 },
|
10
|
+
sale_stopped: { id: 3, name: '売り止め', number: 300 },
|
11
|
+
sale_on_nego: { id: 4, name: '商談中', number: 400 },
|
12
|
+
sale_nego_completed: { id: 5, name: '成約済み', number: nil }
|
13
13
|
},
|
14
14
|
public_scope: {
|
15
15
|
public_to_all: { id: 1, name: '公開' },
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimensional-enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watanabe, Mitsutoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.2.
|
125
|
+
rubygems_version: 2.2.3
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Extends to handle Rails Enum with multi dimensional attributes.
|