Class: CloudhouseGuardian::PolicyList
Instance Attribute Summary
Attributes inherited from BaseObject
#appliance_api_key, #appliance_url, #insecure, #sec_key
Instance Method Summary
collapse
Methods inherited from BaseObject
#http_delete, #http_get, #http_post, #http_put, #make_headers
Constructor Details
#initialize(appliance_url, appliance_api_key, sec_key, insecure) ⇒ PolicyList
Returns a new instance of PolicyList.
13
14
15
16
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 13
def initialize(appliance_url, appliance_api_key, sec_key, insecure)
super(appliance_url, appliance_api_key, sec_key, insecure)
@inner_list = []
end
|
Instance Method Details
#<<(obj) ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 36
def <<(obj)
if ["Policy", "CloudhouseGuardian::Policy"].include?(obj.class.name)
@inner_list << obj
else
raise "Can only append 'Policy' to 'PolicyList'"
end
end
|
#[](idx) ⇒ Object
19
20
21
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 19
def [](idx)
return @inner_list[idx]
end
|
#count ⇒ Object
24
25
26
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 24
def count
return @inner_list.count
end
|
#each(&block) ⇒ Object
30
31
32
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 30
def each(&block)
@inner_list.each(&block)
end
|
#from_hash(h) ⇒ Object
3
4
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 3
def from_hash(h)
end
|
#to_hash ⇒ Object
5
6
7
8
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 5
def to_hash
h = {}
return h
end
|
#to_json ⇒ Object
9
10
11
12
|
# File 'lib/cloudhouse_guardian/PolicyList.rb', line 9
def to_json(options = nil)
h = to_hash
return h.to_json(options)
end
|