Add gogrid idiosyncracies with reloading data

This commit is contained in:
Lucas Carlson 2011-01-26 02:58:12 -08:00 committed by geemus
parent d94e1d5481
commit 5d5c87d1ed
2 changed files with 15 additions and 2 deletions

View File

@ -7,7 +7,7 @@ Gem::Specification.new do |s|
## If your rubyforge_project name is different, then edit it and comment out
## the sub! line in the Rakefile
s.name = 'phpfog-fog'
s.version = '0.4.1.2'
s.version = '0.4.1.3'
s.date = '2011-01-21'
s.rubyforge_project = 'fog'

View File

@ -34,7 +34,20 @@ module Fog
end
def ready?
@state == 'On'
@state && @state["name"] == 'On'
end
def reload
requires :name
begin
if data = collection.get(name)
new_attributes = data.attributes
merge_attributes(new_attributes)
self
end
rescue Excon::Errors::BadRequest
false
end
end
def save