Module: Sumo

Defined in:
lib/sumo.rb,
lib/sumo/version.rb

Overview

This module holds versioning information for the gem.

Defined Under Namespace

Modules: Error Classes: CLI, Client, Collection, Config, Search

Constant Summary collapse

CONFIG_FILE =

Define global constants.

File.expand_path('~/.sumo_creds').freeze
MAJOR =
2
MINOR =
0
PATCH =
1
RELEASE =
nil
VERSION =
[MAJOR, MINOR, PATCH, RELEASE].compact.join('.')
API_VERSION =
1

Class Method Summary collapse

Class Method Details

.clientObject

The default client for the gem.



47
48
49
# File 'lib/sumo.rb', line 47

def client
  @client ||= Sumo::Client.new
end

.client=(new_client) ⇒ Object

Reset the default client for the gem.



53
54
55
# File 'lib/sumo.rb', line 53

def client=(new_client)
  @client = new_client
end

.configObject

The default config for the gem.



35
36
37
# File 'lib/sumo.rb', line 35

def config
  @config ||= Sumo::Config.new
end

.config=(new_config) ⇒ Object

Reset the default config for the gem.



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

def config=(new_config)
  @config = new_config
end

.credsObject

Define top-level functions.



24
25
26
# File 'lib/sumo.rb', line 24

def creds
  @creds ||= config.load_creds!
end

.creds=(new_creds) ⇒ Object



29
30
31
# File 'lib/sumo.rb', line 29

def creds=(new_creds)
  @creds = new_creds
end

.search(*args) ⇒ Object

Create a new search.



59
60
61
# File 'lib/sumo.rb', line 59

def search(*args)
  Sumo::Search.new(*args)
end