arkaan 0.10.30 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c60af71eae7c4a69a944f239ee78378388c7391b
4
- data.tar.gz: 84c944660a7e0596fde32787e30b8f839044e894
3
+ metadata.gz: 3b30a877a72ebfbb8d01fa95128e204c48d4791c
4
+ data.tar.gz: f149d7e43ecb9ee6ea9a11b3b270a3f6e87f7ec5
5
5
  SHA512:
6
- metadata.gz: b6257d4fdf724da296d10560700be8d7290f568b3dbde0b0f233778883efe68972409df8c93d6aa26535da0e87debfe4a74589bdfc5abc225200a195ff7d3a1c
7
- data.tar.gz: 799732959a86ba14642cbff289a4d59a944429a3aab11022ddc43c23105efe9a9764eba6c0ed9ec07aaf30391f192b56ef047a144ed90fd5dffe78c38b265cfc
6
+ metadata.gz: 6a1523574507d5058179b59e9028fdd588209c3eb9abfe3dd4338b0daddaed65a1d7482ffc14da77fc3ac2e47b4b49f847c2597bcc56ca0f2c214aa3533bf54d
7
+ data.tar.gz: 3e84a861858ffae9585c4dbd7db1e1079002b5ec1238a006ea4aff379eafb79f7dc3abb56a44cb81befc7aec764915281f79310399f61531f5ca1d00ee4b8db9
@@ -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?}
@@ -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.10.30
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-16 00:00:00.000000000 Z
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