dimensional-enum 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af647c26e4ae6875f8db96039f1ed32aec3b3007
4
- data.tar.gz: 6781108ffedc8296732d86eff220698b95f3a525
3
+ metadata.gz: 571ec740bc3d6ac07b566524e3ba1c681bc5fbf0
4
+ data.tar.gz: 4b88f39b7a21427a3d71bf8f79fa01c067a9ff7e
5
5
  SHA512:
6
- metadata.gz: f1db3a406c9c3f2ffb19c36a8199b04f6e3f2a2e67698625028148327de1ef80229f87e1bf8560672dfff3756b83eeae3bda522f52764ccad62729e8f0a931a1
7
- data.tar.gz: cf01ebf70e298ef17a29ad1a27e695319eaf755a205db0faa5e1d6f3ddcf34f0d530dbbd0440dd57998b3582a5cd1b2e4f5c1d923b63a83267eb5d68867adb4e
6
+ metadata.gz: ff04c832d47f122221fa4223f42243cfd11a4ad5768d1bbfe2d072e72763247f33f55412800dbd4f0262e3072afc15742c49a4f867887ea086b01514ffef538e
7
+ data.tar.gz: c4f1aedd2cf5e6cf79f5de2eacab237e86c520f6391396e2658c20f22475b0e4b5d42e304243aec7cfcb1787c088f467a8dca6c367f14a43e355a11f7d812132
@@ -2,7 +2,7 @@ module Dimensional
2
2
  module Enum
3
3
  class Attribute
4
4
 
5
- delegate *(String.instance_methods - Object.instance_methods), to: :to_s
5
+ delegate *(String.instance_methods - Object.instance_methods), to: :to_str
6
6
 
7
7
  def initialize( enum_attr_key, enum_attribute )
8
8
  @enum_attr_key = enum_attr_key
@@ -35,10 +35,14 @@ module Dimensional
35
35
  nil
36
36
  end
37
37
 
38
- def to_s
38
+ def to_str
39
39
  label.to_s
40
40
  end
41
41
 
42
+ def to_s
43
+ to_str
44
+ end
45
+
42
46
  def to_sym
43
47
  label.to_sym
44
48
  end
@@ -1,5 +1,5 @@
1
1
  module Dimensional
2
2
  module Enum
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -52,7 +52,14 @@ module Dimensional::Enum
52
52
  expect( enum_attribute == "sale_on_nego" ).to eq true
53
53
  end
54
54
 
55
- describe "Stringを想定したメソッドよびだしがto_sに対しておこなわれること" do
55
+ it "supports right side equality check" do
56
+ enum_attributes = Attributes.new Sample::ENUM_ATTRIBUTES[:core]
57
+ enum_attribute = Attribute.new "sale_on_nego", enum_attributes.to_attribute_h(:sale_state)
58
+ expect( "sale_on_nego" == enum_attribute ).to eq true
59
+ expect( ["sale_running", "sale_on_nego"].include? enum_attribute ).to eq true
60
+ end
61
+
62
+ describe "Stringを想定したメソッドよびだしがto_strに対しておこなわれること" do
56
63
  let(:enum_attributes) { Attributes.new Sample::ENUM_ATTRIBUTES[:core] }
57
64
  let(:enum_attribute) { enum_attribute = Attribute.new "released", enum_attributes.to_attribute_h(:status) }
58
65
  it "#empty?" do
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watanabe, Mitsutoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-21 00:00:00.000000000 Z
11
+ date: 2015-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport