Class: Fog::DNS::SakuraCloud::Mock
- Inherits:
-
Object
- Object
- Fog::DNS::SakuraCloud::Mock
- Defined in:
- lib/fog/sakuracloud/requests/dns/create_zone.rb,
lib/fog/sakuracloud/dns.rb,
lib/fog/sakuracloud/requests/dns/list_zones.rb,
lib/fog/sakuracloud/requests/dns/delete_zone.rb,
lib/fog/sakuracloud/requests/dns/modify_zone.rb
Overview
Real
Class Method Summary collapse
Instance Method Summary collapse
- #create_zone(options) ⇒ Object
- #data ⇒ Object
- #delete_zone(id) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #list_zones(options = {}) ⇒ Object
- #modify_zone(options) ⇒ Object
- #reset_data ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
51 52 53 54 |
# File 'lib/fog/sakuracloud/dns.rb', line 51 def initialize(={}) @sakuracloud_api_token = [:sakuracloud_api_token] @sakuracloud_api_token_secret = [:sakuracloud_api_token_secret] end |
Class Method Details
.data ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/fog/sakuracloud/dns.rb', line 39 def self.data @data ||= Hash.new do |hash, key| hash[key] = { :notes => [] } end end |
.reset ⇒ Object
47 48 49 |
# File 'lib/fog/sakuracloud/dns.rb', line 47 def self.reset @data = nil end |
Instance Method Details
#create_zone(options) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/fog/sakuracloud/requests/dns/create_zone.rb', line 36 def create_zone() response = Excon::Response.new response.status = 201 response.body = { } response end |
#data ⇒ Object
56 57 58 59 |
# File 'lib/fog/sakuracloud/dns.rb', line 56 def data self.class.data[@sakuracloud_api_token] self.class.data[@sakuracloud_api_token_secret] end |
#delete_zone(id) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/fog/sakuracloud/requests/dns/delete_zone.rb', line 20 def delete_zone( id ) response = Excon::Response.new response.status = 200 response.body = { } response end |
#list_zones(options = {}) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fog/sakuracloud/requests/dns/list_zones.rb', line 25 def list_zones( = {}) response = Excon::Response.new response.status = 200 response.body = { } response end |
#modify_zone(options) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/fog/sakuracloud/requests/dns/modify_zone.rb', line 27 def modify_zone() response = Excon::Response.new response.status = 200 response.body = { } response end |
#reset_data ⇒ Object
61 62 63 64 |
# File 'lib/fog/sakuracloud/dns.rb', line 61 def reset_data self.class.data.delete(@sakuracloud_api_token) self.class.data.delete(@sakuracloud_api_token_secret) end |