Class: ZAWS::AWSCLI::Data::IAM::Policy
- Inherits:
-
Object
- Object
- ZAWS::AWSCLI::Data::IAM::Policy
- Defined in:
- lib/zaws/external/awscli/data/iam/policy.rb
Instance Method Summary collapse
- #defaultVersion ⇒ Object
-
#initialize(shellout, iam) ⇒ Policy
constructor
A new instance of Policy.
- #load(command, data, verbose) ⇒ Object
- #validJSON ⇒ Object
- #view ⇒ Object
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
#defaultVersion ⇒ Object
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 |
#validJSON ⇒ Object
13 14 15 |
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 13 def validJSON return (@policy_hash.nil?) end |
#view ⇒ Object
27 28 29 |
# File 'lib/zaws/external/awscli/data/iam/policy.rb', line 27 def view() return @policy_raw_data end |