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.
44 45 46 47 |
# File 'lib/fog/go_grid/compute.rb', line 44 def initialize(={}) @go_grid_api_key = [:go_grid_api_key] @go_grid_shared_secret = [:go_grid_shared_secret] end |
Class Method Details
.data ⇒ Object
34 35 36 37 38 |
# File 'lib/fog/go_grid/compute.rb', line 34 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset ⇒ Object
40 41 42 |
# File 'lib/fog/go_grid/compute.rb', line 40 def self.reset @data = nil end |
Instance Method Details
#data ⇒ Object
49 50 51 |
# File 'lib/fog/go_grid/compute.rb', line 49 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
53 54 55 |
# File 'lib/fog/go_grid/compute.rb', line 53 def reset_data self.class.data.delete(@go_grid_api_key) end |