arkaan 0.5.11 → 0.5.12

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: fcf70bf70d24f51fdabf6768e191af217ae488b6
4
- data.tar.gz: 8a9f598d4c3fbc33e092de6cffd0efb06d3bffff
3
+ metadata.gz: f226febdd30753032b478fcb2ca5f0d42e69c8ac
4
+ data.tar.gz: 1b0c94a0db7435b62fded20629a68da9e6213d46
5
5
  SHA512:
6
- metadata.gz: 11a097fb178fb3290ba249b570c38b76d575b7f2af759c5b185d42f1900439e1b3adca7ab89eb40626ada76c24b833f50ab02297fb178134c8593593260e246a
7
- data.tar.gz: 7dcccfaca1a304f5eb51eaee2a6f71d7d4f62f1e61f4ccc12073bb11e0f69739436ba0da7b0b4c12651db1e5a218bd2155339da7da589980dd7383c91ca7eab3
6
+ metadata.gz: c377c7a4f8588939a6e57254b64e162512c6db116831262100d6459ae47d46641cfdd1887377d6f0f227fd7d16ab0f58d88ff29f6ba907e500a51e424ad365f9
7
+ data.tar.gz: 3e2f7519d572adee40033d26d8542b0712d77cad4ee3485c951bf4a35349b59c8d0893cd88fa91215a6ce7973fad5ae529dc19e7edd97e854cd82510663b28a6
@@ -5,5 +5,6 @@ module Arkaan
5
5
  autoload :Sluggable, 'arkaan/concerns/sluggable'
6
6
  autoload :Activable, 'arkaan/concerns/activable'
7
7
  autoload :Diagnosticable, 'arkaan/concerns/diagnosticable'
8
+ autoload :Premiumable, 'arkaan/concerns/premiumable'
8
9
  end
9
10
  end
@@ -0,0 +1,20 @@
1
+ module Arkaan
2
+ module Concerns
3
+ # Includes the premium field to make the entity including it accessible only to premium applications or not.
4
+ # @author Vincent Courtois <courtois.vincent@outlook.com>
5
+ module Premiumable
6
+ extend ActiveSupport::Concern
7
+
8
+ # Module holding the class methods for the classes including this concern.
9
+ # @author Vincent Courtois <courtois.vincent@outlook.com>
10
+ module ClassMethods
11
+ # Add the premium field when the module is included and this method is called.
12
+ def make_premiumable
13
+ # @!attribute [rw] premium
14
+ # @return [Boolean] TRUE if the entity is made to be accessible only to premiuma pplications, FALSE otherwise.
15
+ field :premium, type: Boolean, default: false
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -5,6 +5,7 @@ module Arkaan
5
5
  class Route
6
6
  include Mongoid::Document
7
7
  include Mongoid::Timestamps
8
+ include Arkaan::Concerns::Premiumable
8
9
 
9
10
  # @!attribute [rw] path
10
11
  # @return [String] the path (URI) of the route in the service?
@@ -13,6 +14,8 @@ module Arkaan
13
14
  # @return [String] the verb (HTTP method) of this route in the service.
14
15
  field :verb, type: String
15
16
 
17
+ make_premiumable
18
+
16
19
  # @!attribute [rw] service
17
20
  # @return [Arkaan::Monitoring::Service] the service in which this route is declared.
18
21
  embedded_in :service, class_name: 'Arkaan::Monitoring::Service', inverse_of: :routes
@@ -7,6 +7,7 @@ module Arkaan
7
7
  include Mongoid::Timestamps
8
8
  include Arkaan::Concerns::Activable
9
9
  include Arkaan::Concerns::Diagnosticable
10
+ include Arkaan::Concerns::Premiumable
10
11
 
11
12
  # @!attribute [rw] key
12
13
  # @return [String] the name, or title of the service, optionally given to identify it more easily.
@@ -17,6 +18,8 @@ module Arkaan
17
18
 
18
19
  make_diagnosticable 'service'
19
20
 
21
+ make_premiumable
22
+
20
23
  # @!attribute [rw] creator
21
24
  # @return [Arkaan::Account] the creator of this service.
22
25
  belongs_to :creator, class_name: 'Arkaan::Account', optional: true, inverse_of: :services
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.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -163,6 +163,7 @@ files:
163
163
  - lib/arkaan/concerns.rb
164
164
  - lib/arkaan/concerns/activable.rb
165
165
  - lib/arkaan/concerns/diagnosticable.rb
166
+ - lib/arkaan/concerns/premiumable.rb
166
167
  - lib/arkaan/concerns/sluggable.rb
167
168
  - lib/arkaan/monitoring.rb
168
169
  - lib/arkaan/monitoring/gateway.rb