roleplay 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/roleplay.rb +10 -0
- data/lib/roleplay/version.rb +1 -1
- data/roleplay.gemspec +1 -1
- metadata +2 -2
data/lib/roleplay.rb
CHANGED
@@ -6,6 +6,16 @@ module Roleplay
|
|
6
6
|
base.send(:extend, ClassMethods)
|
7
7
|
end
|
8
8
|
|
9
|
+
def playing(name)
|
10
|
+
modules = self.class.roles[name]
|
11
|
+
value = self.dup
|
12
|
+
modules.each do |m|
|
13
|
+
value.extend m
|
14
|
+
end
|
15
|
+
value
|
16
|
+
end
|
17
|
+
alias :as_a :playing
|
18
|
+
|
9
19
|
module ClassMethods
|
10
20
|
|
11
21
|
attr_accessor :roles
|
data/lib/roleplay/version.rb
CHANGED
data/roleplay.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.authors = ["James Martin"]
|
10
10
|
gem.email = ["jmartin2683@gmail.com"]
|
11
11
|
gem.description = %q{roles for ruby}
|
12
|
-
gem.summary = %q{group modules into 'roles' and include them into individual
|
12
|
+
gem.summary = %q{group modules into 'roles' and include them into individual instances}
|
13
13
|
gem.homepage = "http://www.thoughtsonrails.com"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roleplay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -67,7 +67,7 @@ rubyforge_project:
|
|
67
67
|
rubygems_version: 1.8.24
|
68
68
|
signing_key:
|
69
69
|
specification_version: 3
|
70
|
-
summary: group modules into 'roles' and include them into individual
|
70
|
+
summary: group modules into 'roles' and include them into individual instances
|
71
71
|
test_files:
|
72
72
|
- spec/roleplay_spec.rb
|
73
73
|
- spec/spec_helper.rb
|