Class: EasyManageClient::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_manage_client/configuration.rb

Overview

Configuration class

Constant Summary collapse

EXTENSION_TYPES =
%w[yaml json].freeze
FILE_EXTENSION_TYPES =
{ 'yaml' => 'yml', 'json' => 'json' }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



49
50
51
52
# File 'lib/easy_manage_client/configuration.rb', line 49

def initialize
  self.profile = :default
  self.extension = 'yaml'
end

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def auth_token
  @auth_token
end

#compile_idObject

Returns the value of attribute compile_id.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def compile_id
  @compile_id
end

#download_folderObject

Returns the value of attribute download_folder.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def download_folder
  @download_folder
end

#extensionObject

Returns the value of attribute extension.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def extension
  @extension
end

#profileObject

Returns the value of attribute profile.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def profile
  @profile
end

#root_urlObject

Returns the value of attribute root_url.



46
47
48
# File 'lib/easy_manage_client/configuration.rb', line 46

def root_url
  @root_url
end

Instance Method Details

#check!Object

Raises:



58
59
60
# File 'lib/easy_manage_client/configuration.rb', line 58

def check!
  raise InvalidExtension unless EXTENSION_TYPES.include?(extension)
end

#file_extensionObject



54
55
56
# File 'lib/easy_manage_client/configuration.rb', line 54

def file_extension
  FILE_EXTENSION_TYPES[extension]
end