planify 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/planify/plan.rb +11 -0
- data/lib/planify/version.rb +1 -1
- data/spec/planify/plan_spec.rb +24 -0
- 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: 595d18a4c9ecc4e451c28de5575543c732c88113
|
4
|
+
data.tar.gz: 38b3fa757c0e0ad67d9bbec323d3e58feb3f9b06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bd6588f16c1660d35de40ce0d0fcd4c60c990cd6dac2fa36bea09ed0ec4fda1bd1c0c84490e8b6ed7e9d14aaa19f061f01d7e57bab17cfedb16ed8e1fc7f398
|
7
|
+
data.tar.gz: bf58aba99084b3b33896c6400736beff979fbfa755f9255d703431b6b87535b6cf1d11c23bcb4cb2e80bfed12d830e523a7c55f61b8993aac36b86fd527bcfd6
|
data/lib/planify/plan.rb
CHANGED
@@ -68,6 +68,17 @@ module Planify
|
|
68
68
|
@price ||= 0.00
|
69
69
|
end
|
70
70
|
|
71
|
+
# Sets or returns the name of this plan
|
72
|
+
# When called without arguments, it returns the name
|
73
|
+
# When called with arguments, the name is set to the first argument provided
|
74
|
+
def name(*args)
|
75
|
+
unless args.empty?
|
76
|
+
@name = args.first
|
77
|
+
end
|
78
|
+
|
79
|
+
@name ||= nil
|
80
|
+
end
|
81
|
+
|
71
82
|
# Sets or returns the description of this plan
|
72
83
|
# When called without arguments, it returns the description
|
73
84
|
# When called with arguments, the description is set to the first argument provided.
|
data/lib/planify/version.rb
CHANGED
data/spec/planify/plan_spec.rb
CHANGED
@@ -145,6 +145,30 @@ describe Planify::Plan do
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
+
describe ".name" do
|
149
|
+
context "with arguments" do
|
150
|
+
it "sets the plan name" do
|
151
|
+
subject.name "Starter Plan"
|
152
|
+
|
153
|
+
subject.name.should == "Starter Plan"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context "without arguments" do
|
158
|
+
before { subject.name("Premium Plan") }
|
159
|
+
|
160
|
+
it "returns the plan name" do
|
161
|
+
subject.name.should == "Premium Plan"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
context "when no name is set" do
|
166
|
+
it "returns nil" do
|
167
|
+
Planify::Plan.new.name.should be_nil
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
148
172
|
describe ".merge!" do
|
149
173
|
|
150
174
|
let(:pro_plan) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: planify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Dayton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.0.
|
98
|
+
rubygems_version: 2.0.7
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: A Mongoid plugin for managing subscription plans and features
|