Class: MrMurano::Tokens

Inherits:
Object
  • Object
show all
Includes:
LocalStorage
Defined in:
lib/MrMurano/Passwords.rb

Overview

The Tokens class manages an end user’s Murano user name and tokens.

Constant Summary collapse

FILENAME =
'tokens'

Constants included from Verbose

Verbose::TABULARIZE_DATA_FORMAT_ERROR

Instance Method Summary collapse

Methods included from LocalStorage

#clear_data_unless_storage_file_exists, #ensure_dirpath!, #fix_permissions_storage_file, #list, #load, #load_data_from_storage_file, #lookup, #remove, #save, #say_if_dry_run, #set, #store_data!, #trace_type

Methods included from Verbose

ask_yes_no, #ask_yes_no, #assert, assert, cmd_confirm_delete!, #cmd_confirm_delete!, debug, #debug, dump_file_json, dump_file_plain, dump_file_yaml, #dump_output_file, #error, error, #error_file_format!, fancy_ticks, #fancy_ticks, #load_file_json, #load_file_plain, #load_file_yaml, #load_input_file, outf, #outf, #outformat_engine, #pluralize?, pluralize?, #prepare_hash_csv, #read_hashf!, #tabularize, tabularize, verbose, #verbose, warning, #warning, #whirly_interject, whirly_interject, #whirly_linger, whirly_linger, #whirly_msg, whirly_msg, #whirly_pause, whirly_pause, #whirly_start, whirly_start, #whirly_stop, whirly_stop, #whirly_unpause, whirly_unpause

Constructor Details

#initialize(path = nil, val_type = nil) ⇒ Tokens

Returns a new instance of Tokens.



187
188
189
190
# File 'lib/MrMurano/Passwords.rb', line 187

def initialize(path=nil, val_type=nil)
  val_type = FILENAME if path.nil?
  super
end

Instance Method Details

#get(host, user) ⇒ Object



192
193
194
195
# File 'lib/MrMurano/Passwords.rb', line 192

def get(host, user)
  return ENV['MURANO_TOKEN'] unless ENV['MURANO_TOKEN'].to_s.empty?
  super
end