Class: Fog::Compute::GoGrid::Mock
- Inherits:
-
Object
- Object
- Fog::Compute::GoGrid::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
- #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.
42 43 44 45 |
# File 'lib/fog/compute/go_grid.rb', line 42 def initialize(={}) @go_grid_api_key = [:go_grid_api_key] @go_grid_shared_secret = [:go_grid_shared_secret] end |
Class Method Details
.data ⇒ Object
32 33 34 35 36 |
# File 'lib/fog/compute/go_grid.rb', line 32 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset ⇒ Object
38 39 40 |
# File 'lib/fog/compute/go_grid.rb', line 38 def self.reset @data = nil end |
Instance Method Details
#data ⇒ Object
47 48 49 |
# File 'lib/fog/compute/go_grid.rb', line 47 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/compute/requests/go_grid/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/compute/requests/go_grid/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
51 52 53 |
# File 'lib/fog/compute/go_grid.rb', line 51 def reset_data self.class.data.delete(@go_grid_api_key) end |