Class: Cloudn::User

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudn_cli/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, opt) ⇒ User

Returns a new instance of User.



13
14
15
16
17
18
19
20
21
# File 'lib/cloudn_cli/shell.rb', line 13

def initialize(name, opt)
  @name       = name.freeze
  @api_key    = opt[:api_key].freeze
  @secret_key = opt[:secret_key].freeze
  url = opt[:url]
  @url = url.is_a?(URI::HTTP) ? url : URI.parse(url)
  @url.freeze      
  @api_location = opt[:api_location].freeze
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



23
24
25
# File 'lib/cloudn_cli/shell.rb', line 23

def api_key
  @api_key
end

#api_locationObject (readonly)

Returns the value of attribute api_location.



23
24
25
# File 'lib/cloudn_cli/shell.rb', line 23

def api_location
  @api_location
end

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/cloudn_cli/shell.rb', line 23

def name
  @name
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



23
24
25
# File 'lib/cloudn_cli/shell.rb', line 23

def secret_key
  @secret_key
end

#urlObject (readonly)

Returns the value of attribute url.



23
24
25
# File 'lib/cloudn_cli/shell.rb', line 23

def url
  @url
end