acts_as_living 0.1.13 → 0.1.14

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
  SHA256:
3
- metadata.gz: a9a3d707aedeaa9b4f50be9387fa7071fcfefb84781400355b7f8db379e9e586
4
- data.tar.gz: 2e14f610949e6758b521a1f8c5eac4362eeca7477d7b2db3a66c083c77540dff
3
+ metadata.gz: 73d33885449af7caca352c2349ec8bb1897f01b6b3d6906b8dd414d4dda6d6c9
4
+ data.tar.gz: e8fc368946103d716e0c84132f9f84662f21ddbf392237de7f2309801c8f0f9b
5
5
  SHA512:
6
- metadata.gz: 555d8a9fddc3d6c334cc0e18fd5f7e038ff2a58a6dfd4fba7ad9dc7ad734291f99ca4c79fd5dc7f44163b5645fb4744d675ddc04e32243beaf2c7a2d737c2a96
7
- data.tar.gz: ad7ff2e43e41feec0338c4118e65f4abd1f06a662b5408b804b512a3aedbc603422890b2ef9d9e53cbf192a609ad389cc3427c7e021a0ada754a21f115106025
6
+ metadata.gz: 5fca0d7f19165ac60768f58cb92c29f516b7746a8078fcadfb13176d5b7899d3a5acfe8018f638a0ea31256e89cbc24075aee378f4df5f33a0e9c7365612d05e
7
+ data.tar.gz: 07e876c5194830496f4bccbd9a6e849e59d102bc7607105152acbe01e197a6978f0194a2c1071f797a5b130bfb8e2ea5b6eda041d2ba2df863e50063382b3d73
@@ -52,8 +52,8 @@ module ActsAsLiving::MethodsDefiner
52
52
  self.class.dying?(stage)
53
53
  end
54
54
 
55
- def newborn?
56
- self.class.newborn?(stage)
55
+ def first_stage?
56
+ self.class.first_stage?(stage)
57
57
  end
58
58
 
59
59
  def dead?
@@ -115,7 +115,7 @@ module ActsAsLiving::MethodsDefiner
115
115
  end
116
116
 
117
117
  def stages_before(stage)
118
- return [] if newborn?(stage)
118
+ return [] if first_stage?(stage)
119
119
 
120
120
  index = stage_keys.find_index(stage)
121
121
  stage_keys[0...index]
@@ -129,30 +129,30 @@ module ActsAsLiving::MethodsDefiner
129
129
  end
130
130
 
131
131
  def stage_before(stage)
132
- return if newborn?(stage)
132
+ return if first_stage?(stage)
133
133
 
134
134
  index = stage_keys.find_index(stage)
135
135
  stage_keys[index - 1]
136
136
  end
137
137
 
138
- def final_stage
139
- stage_keys.last
138
+ def last_stage
139
+ (stage_keys - %i[cancelled]).last
140
140
  end
141
141
 
142
- def dying?(stage)
143
- final_stage == stage
142
+ def last_stage?(stage)
143
+ last_stage == stage
144
144
  end
145
145
 
146
- def newborn_stage
147
- stage_keys.first
146
+ def first_stage_stage
147
+ (stage_keys - %i[cancelled]).first
148
148
  end
149
149
 
150
- def death
151
- @death
150
+ def first_stage?(stage)
151
+ first_stage_stage == stage
152
152
  end
153
153
 
154
- def newborn?(stage)
155
- initial_stage == stage
154
+ def death
155
+ @death
156
156
  end
157
157
 
158
158
  def phases_with_ranges
@@ -1,3 +1,3 @@
1
1
  module ActsAsLiving
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_living
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Andrade