Class: Fog::GoGrid::Compute::Mock
- Inherits:
-
Object
- Object
- Fog::GoGrid::Compute::Mock
- Defined in:
- lib/fog/compute/go_grid.rb,
lib/fog/compute/requests/go_grid/grid_image_get.rb,
lib/fog/compute/requests/go_grid/grid_image_list.rb
Class Method Summary collapse
Instance Method Summary collapse
- #grid_image_get(options = {}) ⇒ Object
- #grid_image_list(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fog/compute/go_grid.rb', line 45 def initialize(={}) unless .delete(:provider) location = caller.first warning = "[yellow][WARN] Fog::GoGrid::Compute.new is deprecated, use Fog::Compute.new(:provider => 'GoGrid') instead[/]" warning << " [light_black](" << location << ")[/] " Formatador.display_line(warning) end @go_grid_api_key = [:go_grid_api_key] @go_grid_shared_secret = [:go_grid_shared_secret] @data = self.class.data[@go_grid_api_key] end |
Class Method Details
.data ⇒ Object
33 34 35 36 37 |
# File 'lib/fog/compute/go_grid.rb', line 33 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset_data(keys = data.keys) ⇒ Object
39 40 41 42 43 |
# File 'lib/fog/compute/go_grid.rb', line 39 def self.reset_data(keys=data.keys) for key in [*keys] data.delete(key) end end |
Instance Method Details
#grid_image_get(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/fog/compute/requests/go_grid/grid_image_get.rb', line 29 def grid_image_get(={}) #response = Excon::Response.new #images = @data[:list].values #for image in images # case image['state'] # when 'Available' end |
#grid_image_list(options = {}) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/fog/compute/requests/go_grid/grid_image_list.rb', line 32 def grid_image_list(={}) #response = Excon::Response.new #images = @data[:list].values #for image in images # case image['state'] # when 'Available' end |