Class: MrMurano::Gateway::GweBase

Inherits:
Object
  • Object
show all
Includes:
AccountBase, SolutionId, SyncAllowed, Verbose
Defined in:
lib/MrMurano/Gateway.rb

Direct Known Subclasses

Device, Resources, Settings

Constant Summary

Constants included from SolutionId

SolutionId::INVALID_API_ID, SolutionId::UNEXPECTED_TYPE_OR_ERROR_MSG

Constants included from Verbose

Verbose::TABULARIZE_DATA_FORMAT_ERROR

Constants included from AccountBase

AccountBase::LOGIN_ADVICE, AccountBase::LOGIN_NOTICE

Instance Attribute Summary

Attributes included from SolutionId

#api_id, #sid, #valid_api_id

Instance Method Summary collapse

Methods included from SyncAllowed

#download_item_allowed, #remove_item_allowed, #removelocal_item_allowed, #sync_item_allowed, #upload_item_allowed

Methods included from SolutionId

#affirm_valid, #api_id?, #init_api_id!, #valid_api_id?

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

Methods included from AccountBase

#add_headers, #ask_for_password!, #ask_for_user!, #cfg_clear_user_and_business, #credentials_reset, #get, #invalidate_token, #login_info, #logout, #must_prompt_if_logged_off!, #token, #token_reset, #verify_cfg_auth!, #verify_cfg_auth_persist, #verify_cfg_auth_scheme!, #verify_cfg_auth_ttl, #verify_set, warn_configfile_env_maybe

Methods included from Http

#add_headers, #curldebug, curldebug_after, curldebug_elapsed, curldebug_log, #delete, #get, #host, #http, #http_reset, #isJSON, #json_opts, #patch, #post, #postf, #put, #showHttpError, #user, #workit, #workit_response

Constructor Details

#initializeGweBase

Returns a new instance of GweBase.



32
33
34
35
36
37
38
39
40
# File 'lib/MrMurano/Gateway.rb', line 32

def initialize
  super
  @solntype = 'product.id'
  @uriparts_apidex = 1
  init_api_id!
  @uriparts = [:service, @api_id, :device2]
  @uriparts_apidex = 1
  @itemkey = :id
end

Instance Method Details

#endpoint(path = '') ⇒ Object

Generate an endpoint in Murano Uses the uriparts and path

Parameters:

  • path (defaults to: '')

    String: any additional parts for the URI

Returns:

  • URI: The full URI for this enpoint.



46
47
48
49
50
51
# File 'lib/MrMurano/Gateway.rb', line 46

def endpoint(path='')
  super
  parts = [$cfg['net.protocol'] + ':/', $cfg['net.host'], 'api:1'] + @uriparts
  s = parts.map(&:to_s).join('/')
  URI(s + path.to_s)
end

#infoObject

Get info for this gateway interface.



56
57
58
# File 'lib/MrMurano/Gateway.rb', line 56

def info
  get
end