Class: VCloudSdk::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, username, password, options) ⇒ Session

Returns a new instance of Session.



30
31
32
33
34
35
36
37
38
39
# File 'lib/ruby_vcloud_sdk/session.rb', line 30

def initialize(url, username, password, options)
  @time_limit = options[:time_limit_sec] || TIME_LIMIT_SEC
  @retries = options[:retries] || RETRIES
  @delay = options[:delay] || DELAY
  @connection = Connection::Connection.new(
    url,
    @time_limit[:http_request])
  @session_xml_obj = @connection.connect(username, password)
  @org_link = @session_xml_obj.organization
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



3
4
5
# File 'lib/ruby_vcloud_sdk/session.rb', line 3

def connection
  @connection
end

#delayObject

Returns the value of attribute delay.



4
5
6
# File 'lib/ruby_vcloud_sdk/session.rb', line 4

def delay
  @delay
end

#retriesObject

Returns the value of attribute retries.



4
5
6
# File 'lib/ruby_vcloud_sdk/session.rb', line 4

def retries
  @retries
end

#time_limitObject

Returns the value of attribute time_limit.



4
5
6
# File 'lib/ruby_vcloud_sdk/session.rb', line 4

def time_limit
  @time_limit
end

Instance Method Details

#orgObject



41
42
43
# File 'lib/ruby_vcloud_sdk/session.rb', line 41

def org
  @connection.get(@org_link)
end