arkaan 0.10.30 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/campaign.rb +4 -0
- data/lib/arkaan/campaigns.rb +2 -1
- data/lib/arkaan/campaigns/message.rb +21 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b30a877a72ebfbb8d01fa95128e204c48d4791c
|
4
|
+
data.tar.gz: f149d7e43ecb9ee6ea9a11b3b270a3f6e87f7ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1523574507d5058179b59e9028fdd588209c3eb9abfe3dd4338b0daddaed65a1d7482ffc14da77fc3ac2e47b4b49f847c2597bcc56ca0f2c214aa3533bf54d
|
7
|
+
data.tar.gz: 3e84a861858ffae9585c4dbd7db1e1079002b5ec1238a006ea4aff379eafb79f7dc3abb56a44cb81befc7aec764915281f79310399f61531f5ca1d00ee4b8db9
|
data/lib/arkaan/campaign.rb
CHANGED
@@ -29,6 +29,10 @@ module Arkaan
|
|
29
29
|
# @return [Array<Arkaan::Campaigns::Invitation>] the invitations to players that have been made for this campaign.
|
30
30
|
has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :campaign
|
31
31
|
|
32
|
+
# @!attribute [rw] messages
|
33
|
+
# @return [Array<Arkaan::Campaigns::Message>] the messages sent in the chatroom of the campaign.
|
34
|
+
embeds_many :messages, class_name: 'Arkaan::Campaigns::Message', inverse_of: :campaign
|
35
|
+
|
32
36
|
validates :title,
|
33
37
|
presence: {message: 'required'},
|
34
38
|
length: {minimum: 4, message: 'minlength', if: :title?}
|
data/lib/arkaan/campaigns.rb
CHANGED
@@ -2,7 +2,8 @@ module Arkaan
|
|
2
2
|
# The campaigns module is holding the logic for some objects related to campaigns.
|
3
3
|
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
4
4
|
module Campaigns
|
5
|
-
autoload :Tag, 'arkaan/campaigns/tag'
|
6
5
|
autoload :Invitation, 'arkaan/campaigns/invitation'
|
6
|
+
autoload :Message , 'arkaan/campaigns/message'
|
7
|
+
autoload :Tag , 'arkaan/campaigns/tag'
|
7
8
|
end
|
8
9
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Campaigns
|
3
|
+
# This model represents an in-game tchat message sent in the tchat of a campaign.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
+
class Message
|
6
|
+
include Mongoid::Document
|
7
|
+
include Mongoid::Timestamps
|
8
|
+
|
9
|
+
# @!attribute [rw] content
|
10
|
+
# @return [String] the content of the message as raw text.
|
11
|
+
field :content, type: String
|
12
|
+
|
13
|
+
# @!attribute [rw] campaign
|
14
|
+
# @return [Arkaan::Campaign] the campaign in which the message has been emitted.
|
15
|
+
embedded_in :campaign, class_name: 'Arkaan::Campaign', inverse_of: :messages
|
16
|
+
# @!attribute [rw] player
|
17
|
+
# @return [Arkaan::Account] the account that has emitted the message in the campaign.
|
18
|
+
belongs_to :player, class_name: 'Arkaan::Campaign::Invitation'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkaan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -261,6 +261,7 @@ files:
|
|
261
261
|
- lib/arkaan/campaign.rb
|
262
262
|
- lib/arkaan/campaigns.rb
|
263
263
|
- lib/arkaan/campaigns/invitation.rb
|
264
|
+
- lib/arkaan/campaigns/message.rb
|
264
265
|
- lib/arkaan/campaigns/tag.rb
|
265
266
|
- lib/arkaan/concerns.rb
|
266
267
|
- lib/arkaan/concerns/activable.rb
|