Class: Yao::Resources::SecurityGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/yao/resources/security_group.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#api_version, #service

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated

Methods included from RestfullyAccessible

#admin=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #list, #resources_path, #resources_path=, #return_single_on_querying=, #update, #with_resources_path

Constructor Details

This class inherits a constructor from Yao::Resources::Base

Instance Method Details

#rulesObject



6
7
8
9
10
11
12
13
# File 'lib/yao/resources/security_group.rb', line 6

def rules
  self[["rules", SecurityGroupRule].join("__")] ||= (case self.class.service
  when "compute"
    self["rules"].map{|r| SecurityGroupRule.new(r) }
  when "network"
    self["security_group_rules"].map{|r| SecurityGroupRule.new(r) }
  end)
end