class Conoha::Config
Attributes
accounts[R]
authtoken[R]
password[R]
public_key[R]
tenant_id[R]
username[R]
Public Instance Methods
authtoken=(authtoken)
click to toggle source
# File lib/conoha/config.rb, line 45 def authtoken=(authtoken) @authtoken = authtoken end
load_from_json!(json_str)
click to toggle source
# File lib/conoha/config.rb, line 34 def load_from_json!(json_str) parsed = JSON.parse json_str raise Error.new unless parsed.is_a? Hash @username = parsed["username"] @password = parsed["password"] @tenant_id = parsed["tenant_id"] @public_key = parsed["public_key"] @authtoken = parsed["authtoken"] @accounts = parsed["accounts"]&.map { |e| Account.new e } end
load_from_yaml!(yaml_str)
click to toggle source
# File lib/conoha/config.rb, line 29 def load_from_yaml!(yaml_str) loaded = YAML.load yaml_str raise Error.new unless loaded.is_a? Hash end