transitionable 0.3.0 → 0.3.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: 54fe1db2c558071ebf31786937491e86fdb7f40f
4
- data.tar.gz: de76dac91d7bfae85136997d46ef25f2e3dc5cd2
3
+ metadata.gz: 17b36313626fb63024ebe0c211a7270420e179c9
4
+ data.tar.gz: 264abb2c7db835c96963665f3df3507d2557b8e1
5
5
  SHA512:
6
- metadata.gz: 5ef6dcf574eb6c1f0e6b2873989aec8411d2aa3281a8ea5bf56894aacc77d91fbe6d66cbebeff406ceed357b1b9b6ef1c8c342474f004ab8514e13a6c5397ed8
7
- data.tar.gz: 03e6a03d97e62f050fd6f2f74f60938ae8efa97b7f84a8f60413b3943f4d0dc6deaaa9c6068fbe45b4dae72fe4ab801b584249ebd263643148ee77e126c6da57
6
+ metadata.gz: d58b580082136207cdb9fccc9eb98862ed020c86bef51236c8fd646a96125d9df2ad83047ea1be9ad57dd3123173823ece4a68ed86524579b1db3b10a4490f10
7
+ data.tar.gz: e5d4ff7ea42f13d4c8a367936045ad1f3b60122e3043ed0a33c1f7b592e8b6927b30f3177e1ad2be7bf19c73998c402ea19e38109d0896846ab046729b5cc469
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transitionable (0.3.0)
4
+ transitionable (0.3.1)
5
5
  activesupport (~> 5.2)
6
6
 
7
7
  GEM
@@ -13,7 +13,7 @@ GEM
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
15
  coderay (1.1.2)
16
- concurrent-ruby (1.0.5)
16
+ concurrent-ruby (1.1.3)
17
17
  diff-lcs (1.3)
18
18
  i18n (1.1.1)
19
19
  concurrent-ruby (~> 1.0)
@@ -23,8 +23,9 @@ module Transitionable
23
23
  self.state_machines ||= {}
24
24
  self.state_machines[name] = { states: states.values, transitions: transitions }
25
25
  self.state_machines[name][:states].each do |this_state|
26
- raise 'Method already defined' if self.new.respond_to? this_state
27
- define_method "#{this_state}?" do
26
+ method_name = "#{this_state}?".to_sym
27
+ raise 'Method already defined' if self.instance_methods(false).include?(method_name)
28
+ define_method method_name do
28
29
  current_state_based_on(this_state) == this_state
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Transitionable
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transitionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - zino