Class: Fog::Compute::GoGrid::Mock
- Inherits:
-
Object
- Object
- Fog::Compute::GoGrid::Mock
- Defined in:
- lib/fog/go_grid/compute.rb,
lib/fog/go_grid/requests/compute/grid_image_get.rb,
lib/fog/go_grid/requests/compute/grid_image_list.rb
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
- #grid_image_get(options = {}) ⇒ Object
- #grid_image_list(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #reset_data ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
45 46 47 48 |
# File 'lib/fog/go_grid/compute.rb', line 45 def initialize(={}) @go_grid_api_key = [:go_grid_api_key] @go_grid_shared_secret = [:go_grid_shared_secret] end |
Class Method Details
.data ⇒ Object
35 36 37 38 39 |
# File 'lib/fog/go_grid/compute.rb', line 35 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset ⇒ Object
41 42 43 |
# File 'lib/fog/go_grid/compute.rb', line 41 def self.reset @data = nil end |
Instance Method Details
#data ⇒ Object
50 51 52 |
# File 'lib/fog/go_grid/compute.rb', line 50 def data self.class.data[@go_grid_api_key] end |
#grid_image_get(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/fog/go_grid/requests/compute/grid_image_get.rb', line 29 def grid_image_get(={}) #response = Excon::Response.new #images = self.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/go_grid/requests/compute/grid_image_list.rb', line 32 def grid_image_list(={}) #response = Excon::Response.new #images = self.data[:list].values #for image in images # case image['state'] # when 'Available' end |
#reset_data ⇒ Object
54 55 56 |
# File 'lib/fog/go_grid/compute.rb', line 54 def reset_data self.class.data.delete(@go_grid_api_key) end |