Class: Licensed::Commands::Environment::AppEnvironment
- Inherits:
-
Object
- Object
- Licensed::Commands::Environment::AppEnvironment
- Includes:
- Sources::ContentVersioning
- Defined in:
- lib/licensed/commands/environment.rb
Constant Summary
Constants included from Sources::ContentVersioning
Sources::ContentVersioning::CONTENTS, Sources::ContentVersioning::GIT
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #enabled_source_types ⇒ Object
-
#initialize(config) ⇒ AppEnvironment
constructor
A new instance of AppEnvironment.
- #to_h ⇒ Object
Methods included from Sources::ContentVersioning
#contents_hash, #contents_version, #git_version, #version_strategy
Constructor Details
#initialize(config) ⇒ AppEnvironment
Returns a new instance of AppEnvironment.
9 10 11 |
# File 'lib/licensed/commands/environment.rb', line 9 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/licensed/commands/environment.rb', line 8 def config @config end |
Instance Method Details
#enabled_source_types ⇒ Object
13 14 15 |
# File 'lib/licensed/commands/environment.rb', line 13 def enabled_source_types config.sources.select { |s| s.enabled? }.map { |s| s.class.type } end |
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/licensed/commands/environment.rb', line 17 def to_h { "name" => config["name"], "source_path" => config.source_path, "cache_path" => config.cache_path, "sources" => enabled_source_types, "allowed" => config["allowed"], "ignored" => config["ignored"], "reviewed" => config["reviewed"], "version_strategy" => self.version_strategy, "root" => config.root } end |