arkaan 0.5.4 → 0.5.5

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: 18d230ffa3ef80986d2ff4cd09eb1c0a7821fd9e
4
- data.tar.gz: 9c97b1b1340d6321323121d5774cac905b3fa9e0
3
+ metadata.gz: 0ab81c60f81276ca7e0405ba1a2d278d306bd16e
4
+ data.tar.gz: c37126260296a51411f8f667fe76d55c8c1f2eab
5
5
  SHA512:
6
- metadata.gz: 84e7d129e2863836f69c0beae278386b59da9d87b0d676e3c6c935676c6698e104cee41da4ea65afbde980b716e352262b7e606143e8e54b1fadbb8e1eeb8e31
7
- data.tar.gz: ab6b0e75ea42271678137898e164e3b41223327402facfa61e56e5b3bac43a6a5b5b294c402d06a180ed94aae320a85bf78c6f3a10ec9441722db3acf84a3885
6
+ metadata.gz: 48e83eb4063aabdaed703bc8c75d3f7485a88d7e396c66d48f388830a3380db9fc91ac1b6ca55cf79c234e25d99d1cd9882389143f5f02b8e2824e91da57be15
7
+ data.tar.gz: 203dbd24f11e37606a8615d23ffaa5b2372c6438f6405925fc45b701b3a72049eb1f06660a24c028f828039630a0c1303b8a4923f95c5a8607c4d119d5b49b39
@@ -3,5 +3,6 @@ module Arkaan
3
3
  # @authro Vincent Courtois <courtois.vincent@outlook.com>
4
4
  module Concerns
5
5
  autoload :Sluggable, 'arkaan/concerns/sluggable'
6
+ autoload :Activable, 'arkaan/concerns/activable'
6
7
  end
7
8
  end
@@ -0,0 +1,18 @@
1
+ module Arkaan
2
+ module Concerns
3
+ # Concerns for the objects that can be activated or deactivated, included the corresponding scopes.
4
+ # @author Vincent Courtois <courtois.vincent@outlook.com>
5
+ module Activable
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ # @!attribute [rw] active
10
+ # @return [Boolean] the active status of the instance, indicating if someone has deactivated it or not.
11
+ field :active, type: Boolean, default: false
12
+
13
+ scope :active , ->{ where(active: true) }
14
+ scope :inactive, ->{ where(active: false) }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -5,10 +5,16 @@ module Arkaan
5
5
  class Instance
6
6
  include Mongoid::Document
7
7
  include Mongoid::Timestamps
8
+ include Arkaan::Concerns::Activable
8
9
 
9
10
  # @!attribute [rw] url
10
11
  # @return [String] the URL of the instance, where the requests will be issued.
11
12
  field :url, type: String
13
+ # @!attribute [rw] running
14
+ # @return [Boolean] the running status of the instance, indicating if it can be used or not.
15
+ field :running, type: Boolean, default: false
16
+
17
+ scope :running , ->{ where(running: true) }
12
18
 
13
19
  # @!attribute [r] service
14
20
  # @return [Arkaan::Monitoring::Service] the service this instance is linked to.
@@ -5,6 +5,7 @@ module Arkaan
5
5
  class Service
6
6
  include Mongoid::Document
7
7
  include Mongoid::Timestamps
8
+ include Arkaan::Concerns::Activable
8
9
 
9
10
  # @!attribute [rw] key
10
11
  # @return [String] the name, or title of the service, optionally given to identify it more easily.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkaan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois
@@ -159,6 +159,7 @@ files:
159
159
  - lib/arkaan.rb
160
160
  - lib/arkaan/account.rb
161
161
  - lib/arkaan/concerns.rb
162
+ - lib/arkaan/concerns/activable.rb
162
163
  - lib/arkaan/concerns/sluggable.rb
163
164
  - lib/arkaan/monitoring.rb
164
165
  - lib/arkaan/monitoring/instance.rb