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:
parent
daec413bd1
commit
5ee8682499
2 changed files with 4 additions and 5 deletions
|
@ -35,6 +35,8 @@ class VcloudngParser < Fog::Parsers::Base
|
|||
end
|
||||
end
|
||||
|
||||
class NonLoaded
|
||||
end
|
||||
|
||||
|
||||
module Fog
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue