Class: Fog::Scaleway::Compute::SecurityGroup
- Inherits:
-
Model
- Object
- Model
- Fog::Scaleway::Compute::SecurityGroup
- Defined in:
- lib/fog/scaleway/models/compute/security_group.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
39 40 41 42 43 44 |
# File 'lib/fog/scaleway/models/compute/security_group.rb', line 39 def destroy requires :identity service.delete_security_group(identity) true end |
#rules ⇒ Object
27 28 29 |
# File 'lib/fog/scaleway/models/compute/security_group.rb', line 27 def rules service.security_group_rules(security_group: self) end |
#save ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/fog/scaleway/models/compute/security_group.rb', line 31 def save if persisted? update else create end end |
#servers=(value) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/scaleway/models/compute/security_group.rb', line 14 def servers=(value) attributes[:servers] = value.map do |v| case v when Hash service.servers.new(v) when String service.servers.new(identity: v) else v end end end |