Class: EY::CloudClient::Test::Scenario
- Inherits:
-
Object
- Object
- EY::CloudClient::Test::Scenario
- Defined in:
- lib/engineyard-cloud-client/test/scenario.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Class Method Summary collapse
Instance Method Summary collapse
- #cloud_client ⇒ Object
-
#initialize(options) ⇒ Scenario
constructor
A new instance of Scenario.
- #inspect ⇒ Object
Constructor Details
#initialize(options) ⇒ Scenario
Returns a new instance of Scenario.
27 28 29 30 31 32 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 27 def initialize() @name = ['name'] @email = ['email'] @password = ['password'] @api_token = ['api_token'] end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
25 26 27 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 25 def api_token @api_token end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
25 26 27 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 25 def email @email end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
25 26 27 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 25 def password @password end |
Class Method Details
.[](name) ⇒ Object
8 9 10 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 8 def self.[](name) scenarios[name] or raise "Scenario #{name.inspect} not found in:\n\t#{scenarios.keys.join("\n\t")}" end |
.load_scenarios ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 16 def self.load_scenarios response = ::RestClient.get(EY::CloudClient::Test::FakeAwsm.uri.sub(/\/?$/,'/scenarios')) data = MultiJson.load(response) data['scenarios'].inject({}) do |hsh, scenario| hsh[scenario['name']] = new(scenario) hsh end end |
.scenarios ⇒ Object
12 13 14 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 12 def self.scenarios @scenarios ||= load_scenarios end |
Instance Method Details
#cloud_client ⇒ Object
34 35 36 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 34 def cloud_client EY::CloudClient.new(:endpoint => EY::CloudClient::Test::FakeAwsm.uri, :token => @api_token) end |
#inspect ⇒ Object
38 39 40 |
# File 'lib/engineyard-cloud-client/test/scenario.rb', line 38 def inspect "#<Test::Scenario name:#@name>" end |