Class: EY::Serverside::CLI::ServerHashExtractor
- Inherits:
-
Object
- Object
- EY::Serverside::CLI::ServerHashExtractor
- Defined in:
- lib/engineyard-serverside/cli/server_hash_extractor.rb
Overview
ServerHashExtractor, given an options hash and a deploy configuration, generates an array of hashes that can be used to instantiate Server objects
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #hashes ⇒ Object
-
#initialize(options, config) ⇒ ServerHashExtractor
constructor
A new instance of ServerHashExtractor.
Constructor Details
#initialize(options, config) ⇒ ServerHashExtractor
Returns a new instance of ServerHashExtractor.
15 16 17 18 |
# File 'lib/engineyard-serverside/cli/server_hash_extractor.rb', line 15 def initialize(, config) @options = @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
13 14 15 |
# File 'lib/engineyard-serverside/cli/server_hash_extractor.rb', line 13 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/engineyard-serverside/cli/server_hash_extractor.rb', line 13 def @options end |
Class Method Details
.hashes(options, config) ⇒ Object
9 10 11 |
# File 'lib/engineyard-serverside/cli/server_hash_extractor.rb', line 9 def self.hashes(, config) new(, config).hashes end |
Instance Method Details
#hashes ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/engineyard-serverside/cli/server_hash_extractor.rb', line 20 def hashes return [] unless instances instances.collect {|hostname| { :hostname => hostname, :roles => instance_roles[hostname].to_s.split(','), :name => instance_names[hostname], :user => config.user } } end |