Class: Train::Transports::Helpers::Azure::FileParser
- Inherits:
-
Object
- Object
- Train::Transports::Helpers::Azure::FileParser
- Defined in:
- lib/train/transports/helpers/azure/file_parser.rb
Instance Method Summary collapse
-
#initialize(credentials) ⇒ FileParser
constructor
A new instance of FileParser.
- #subscription_id ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(credentials) ⇒ FileParser
Returns a new instance of FileParser.
7 8 9 10 11 |
# File 'lib/train/transports/helpers/azure/file_parser.rb', line 7 def initialize(credentials) @credentials = credentials validate! end |
Instance Method Details
#subscription_id ⇒ Object
19 20 21 |
# File 'lib/train/transports/helpers/azure/file_parser.rb', line 19 def subscription_id @subscription_id ||= @credentials.sections[0] end |
#validate! ⇒ Object
13 14 15 16 17 |
# File 'lib/train/transports/helpers/azure/file_parser.rb', line 13 def validate! return if @credentials.sections.count == 1 raise "Credentials file must have one entry. Check your credentials file. If you have more than one entry set AZURE_SUBSCRIPTION_ID environment variable." end |