lib/fog/aliyun/models/compute/security_groups.rb in fog-aliyun-0.1.0 vs lib/fog/aliyun/models/compute/security_groups.rb in fog-aliyun-0.2.0
- old
+ new
@@ -5,29 +5,28 @@
module Compute
class Aliyun
class SecurityGroups < Fog::Collection
model Fog::Compute::Aliyun::SecurityGroup
- def all(options={})
+ def all(options = {})
data = Fog::JSON.decode(service.list_security_groups(options).body)['SecurityGroups']['SecurityGroup']
load(data)
- #['Images']['Image']
+ # ['Images']['Image']
end
def get(security_group_id)
if security_group_id
- data=self.class.new(:service=>service).all()
- result=nil
+ data = self.class.new(service: service).all
+ result = nil
data.each do |i|
- if(i.id==security_group_id)
- result=i
+ if i.id == security_group_id
+ result = i
break
end
end
result
end
end
-
end
end
end
end