planify 1.0.1 → 1.0.2

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: 895a08ebad3001a3d2f93ac311c480fa4737c9d2
4
- data.tar.gz: defff6ce05ca94f201d38ff14cb8c48401ded5ec
3
+ metadata.gz: 595d18a4c9ecc4e451c28de5575543c732c88113
4
+ data.tar.gz: 38b3fa757c0e0ad67d9bbec323d3e58feb3f9b06
5
5
  SHA512:
6
- metadata.gz: c33faa819fc593900eda98752c7531f4db1cfb2de3cef927c46af771a0910f6ce24f517e1a1ebf7d33ca5fc7f1fc286492d77487577f81e5b3d5db85aca0740c
7
- data.tar.gz: be9e24e3f82f37c9ae085ae6c1b5eec7e65d205d72936e499d3c585038dd36c59361c26fbad2464c839e73fd14e45ef2fae991e45228a66306a3787875c13bfa
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.
@@ -1,3 +1,3 @@
1
1
  module Planify
2
- VERSION = [1, 0, 1].join(".")
2
+ VERSION = [1, 0, 2].join(".")
3
3
  end
@@ -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.1
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-20 00:00:00.000000000 Z
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.3
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