Class: Envirobly::Target
- Inherits:
-
Object
- Object
- Envirobly::Target
- Defined in:
- lib/envirobly/target.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#region ⇒ Object
Returns the value of attribute region.
Instance Method Summary collapse
- #environ_name ⇒ Object
- #ignored_params ⇒ Object
-
#initialize(default_account_id: nil, default_project_id: nil, default_region: nil, default_project_name: nil, default_environ_name: nil, account_id: nil, project_id: nil, region: nil, project_name: nil, environ_name: nil) ⇒ Target
constructor
A new instance of Target.
- #missing_params ⇒ Object
- #project_name ⇒ Object
Constructor Details
#initialize(default_account_id: nil, default_project_id: nil, default_region: nil, default_project_name: nil, default_environ_name: nil, account_id: nil, project_id: nil, region: nil, project_name: nil, environ_name: nil) ⇒ Target
Returns a new instance of Target.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/envirobly/target.rb', line 7 def initialize( default_account_id: nil, default_project_id: nil, default_region: nil, default_project_name: nil, default_environ_name: nil, account_id: nil, project_id: nil, region: nil, project_name: nil, environ_name: nil ) @default_account_id = default_account_id @default_project_id = default_project_id @default_region = default_region @default_project_name = default_project_name @default_environ_name = default_environ_name @account_id = account_id @project_id = project_id @region = region @project_name = project_name @environ_name = environ_name end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/envirobly/target.rb', line 5 def account_id @account_id end |
#project_id ⇒ Object
Returns the value of attribute project_id.
5 6 7 |
# File 'lib/envirobly/target.rb', line 5 def project_id @project_id end |
#region ⇒ Object
Returns the value of attribute region.
5 6 7 |
# File 'lib/envirobly/target.rb', line 5 def region @region end |
Instance Method Details
#environ_name ⇒ Object
61 62 63 |
# File 'lib/envirobly/target.rb', line 61 def environ_name @environ_name.presence || @default_environ_name end |
#ignored_params ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/envirobly/target.rb', line 71 def ignored_params [].tap do |result| if @account_id && @project_id result << :account_id end if @project_id && @region result << :region end if @project_id && @project_name.present? result << :project_name end end end |
#missing_params ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/envirobly/target.rb', line 31 def missing_params [].tap do |result| if project_id.blank? && account_id.blank? result << :account_id end if project_id.blank? && region.blank? result << :region end end end |
#project_name ⇒ Object
55 56 57 58 59 |
# File 'lib/envirobly/target.rb', line 55 def project_name return if @project_id @project_name.presence || @default_project_name end |