Module: Enstratus

Defined in:
lib/enstratus.rb,
lib/enstratus/admin.rb,
lib/enstratus/finance.rb,
lib/enstratus/network.rb,
lib/enstratus/request.rb,
lib/enstratus/version.rb,
lib/enstratus/platform.rb,
lib/enstratus/resource.rb,
lib/enstratus/analytics.rb,
lib/enstratus/geography.rb,
lib/enstratus/automation.rb,
lib/enstratus/configuration.rb,
lib/enstratus/infrastructure.rb,
lib/enstratus/request_signer.rb

Defined Under Namespace

Modules: Admin, Analytics, Automation, Finance, Geography, Infrastructure, Network, Platform, ResourceClassMethods Classes: Configuration, Request, RequestSigner, Resource

Constant Summary collapse

UA =
"enstratus.rb"
VERSION =
"0.0.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



12
13
14
# File 'lib/enstratus.rb', line 12

def configuration
  @configuration
end

Class Method Details

.configure(config_file = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/enstratus.rb', line 15

def self.configure(config_file=nil)
  self.configuration ||= Configuration.new
  if config_file.nil?
    yield(configuration)
  else
    begin
      c = YAML.load(File.open(config_file, 'r'){|f| f.read})
      c.each do |k,v|
        self.configuration.instance_variable_set("@#{k}", v)
      end
    rescue Exception => e
      puts e.message
    end
  end
end

.debug?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/enstratus.rb', line 31

def self.debug?
  Enstratus.configuration.debug || false
end