Class: ZAWS::AWSCLI::Data::IAM::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/zaws/external/awscli/data/iam/policy.rb

Instance Method Summary collapse

Constructor Details

#initialize(shellout, iam) ⇒ Policy

Returns a new instance of Policy.



7
8
9
10
11
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 7

def initialize(shellout,iam)
      @shellout=shellout
      @iam=iam
		     	@policy_hash=nil
end

Instance Method Details

#defaultVersionObject



31
32
33
34
35
36
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 31

def defaultVersion()
     if @policy_hash and @policy_hash["Policy"] and @policy_hash["Policy"]["DefaultVersionId"]
 return @policy_hash["Policy"]["DefaultVersionId"]
  end
			return nil
end

#load(command, data, verbose) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 17

def load(command,data,verbose)
			@policy_raw_data = data 
			verbose.puts(@policy_raw_data) if verbose 
			@policy_hash=nil
			begin
 @policy_hash =JSON.parse(data)
			rescue JSON::ParserError => e
			end
end

#validJSONObject



13
14
15
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 13

def validJSON
			return (@policy_hash.nil?)
end

#viewObject



27
28
29
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 27

def view()
			return @policy_raw_data 
end