Class: AwsSessionToken::Options
- Inherits:
-
Object
- Object
- AwsSessionToken::Options
- Defined in:
- lib/aws_session_token/options.rb
Overview
Options class to define properties for the command line.
Constant Summary collapse
- SESSION_PROFILE =
'session_profile'
- DURATION =
3600
Instance Attribute Summary collapse
-
#console ⇒ Object
Returns the value of attribute console.
-
#credentials_file ⇒ Object
Returns the value of attribute credentials_file.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#profile_provided ⇒ Object
Returns the value of attribute profile_provided.
-
#session_profile ⇒ Object
Returns the value of attribute session_profile.
-
#token ⇒ Object
Returns the value of attribute token.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #parse(args) ⇒ Object
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
31 32 33 34 35 36 37 38 |
# File 'lib/aws_session_token/options.rb', line 31 def initialize creds = Aws::SharedCredentials.new self.credentials_file = creds.path self.profile = creds.profile_name self.duration = DURATION self.profile_provided = false self.console = false end |
Instance Attribute Details
#console ⇒ Object
Returns the value of attribute console.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def console @console end |
#credentials_file ⇒ Object
Returns the value of attribute credentials_file.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def credentials_file @credentials_file end |
#duration ⇒ Object
Returns the value of attribute duration.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def duration @duration end |
#profile ⇒ Object
Returns the value of attribute profile.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def profile @profile end |
#profile_provided ⇒ Object
Returns the value of attribute profile_provided.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def profile_provided @profile_provided end |
#session_profile ⇒ Object
Returns the value of attribute session_profile.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def session_profile @session_profile end |
#token ⇒ Object
Returns the value of attribute token.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def token @token end |
#user ⇒ Object
Returns the value of attribute user.
29 30 31 |
# File 'lib/aws_session_token/options.rb', line 29 def user @user end |
Instance Method Details
#parse(args) ⇒ Object
40 41 42 43 |
# File 'lib/aws_session_token/options.rb', line 40 def parse(args) .parse!(args) validate end |