Class: CC::Config::Engine
- Inherits:
-
Object
- Object
- CC::Config::Engine
- Defined in:
- lib/cc/config/engine.rb
Constant Summary collapse
- DEFAULT_CHANNEL =
"stable".freeze
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#enabled ⇒ Object
writeonly
Sets the attribute enabled.
-
#exclude_patterns ⇒ Object
readonly
Returns the value of attribute exclude_patterns.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #container_label ⇒ Object
- #enabled? ⇒ Boolean
- #eql?(other) ⇒ Boolean (also: #==, #equal?)
- #hash ⇒ Object
-
#initialize(name, enabled: false, channel: nil, config: nil, exclude_patterns: []) ⇒ Engine
constructor
A new instance of Engine.
- #plugin? ⇒ Boolean
Constructor Details
#initialize(name, enabled: false, channel: nil, config: nil, exclude_patterns: []) ⇒ Engine
Returns a new instance of Engine.
10 11 12 13 14 15 16 |
# File 'lib/cc/config/engine.rb', line 10 def initialize(name, enabled: false, channel: nil, config: nil, exclude_patterns: []) @name = name @enabled = enabled @channel = channel || DEFAULT_CHANNEL @config = config || {} @exclude_patterns = exclude_patterns end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
6 7 8 |
# File 'lib/cc/config/engine.rb', line 6 def channel @channel end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/cc/config/engine.rb', line 7 def config @config end |
#enabled=(value) ⇒ Object (writeonly)
Sets the attribute enabled
8 9 10 |
# File 'lib/cc/config/engine.rb', line 8 def enabled=(value) @enabled = value end |
#exclude_patterns ⇒ Object (readonly)
Returns the value of attribute exclude_patterns.
7 8 9 |
# File 'lib/cc/config/engine.rb', line 7 def exclude_patterns @exclude_patterns end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cc/config/engine.rb', line 7 def name @name end |
Instance Method Details
#container_label ⇒ Object
26 27 28 |
# File 'lib/cc/config/engine.rb', line 26 def container_label @container_label ||= SecureRandom.uuid end |
#enabled? ⇒ Boolean
18 19 20 |
# File 'lib/cc/config/engine.rb', line 18 def enabled? @enabled end |
#eql?(other) ⇒ Boolean Also known as: ==, equal?
34 35 36 |
# File 'lib/cc/config/engine.rb', line 34 def eql?(other) other.is_a?(self.class) && name.eql?(other.name) end |
#hash ⇒ Object
30 31 32 |
# File 'lib/cc/config/engine.rb', line 30 def hash name.hash end |
#plugin? ⇒ Boolean
22 23 24 |
# File 'lib/cc/config/engine.rb', line 22 def plugin? !DefaultAdapter::ENGINES.keys.include?(name) end |