1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

using NonLoaded class instead of nil

This commit is contained in:
Rodrigo Estebanez 2013-07-08 20:31:37 +02:00
parent daec413bd1
commit 5ee8682499
2 changed files with 4 additions and 5 deletions

View file

@ -35,6 +35,8 @@ class VcloudngParser < Fog::Parsers::Base
end
end
class NonLoaded
end
module Fog

View file

@ -30,18 +30,15 @@ module Fog
def initialize(attrs={})
super(attrs)
[:description].each do |attr|
attributes[attr]='<non_set>' if attributes[attr].nil?
end
attributes[:description]= NonLoaded if attributes[:description].nil?
end
def description
reload if ( attributes[:description] == '<non_set>' and @inspecting == false )
reload if attributes[:description] == NonLoaded and !@inspecting
attributes[:description]
end
def inspect
puts 'inspecting'
@inspecting = true
out = super
@inspecting = false