Module: Hoth

Defined in:
lib/hoth.rb,
lib/hoth/modules.rb,
lib/hoth/service.rb,
lib/hoth/endpoint.rb,
lib/hoth/services.rb,
lib/hoth/transport.rb,
lib/hoth/exceptions.rb,
lib/hoth/util/logger.rb,
lib/hoth/encoding/json.rb,
lib/hoth/encoding/no_op.rb,
lib/hoth/service_module.rb,
lib/hoth/transport/base.rb,
lib/hoth/transport/bert.rb,
lib/hoth/transport/http.rb,
lib/hoth/transport/https.rb,
lib/hoth/service_registry.rb,
lib/hoth/service_definition.rb,
lib/hoth/transport/workling.rb,
lib/hoth/transport/beanstalkd.rb,
lib/hoth/providers/rack_provider.rb,
lib/hoth/providers/bertrpc_provider.rb,
lib/hoth/providers/beanstalkd_provider.rb

Defined Under Namespace

Modules: Encoding, Providers, Transport Classes: EmptyServiceNameError, EncodingError, Endpoint, HothException, Logger, Modules, RecursiveServiceCallException, Service, ServiceDefinition, ServiceModule, ServiceNotFoundException, ServiceRegistry, Services, TransportError, TransportException

Class Method Summary collapse

Class Method Details

.client_uuidObject



33
34
35
# File 'lib/hoth.rb', line 33

def client_uuid
  @client_uuid
end

.config_pathObject



37
38
39
# File 'lib/hoth.rb', line 37

def config_path
  @config_path || "config/"
end

.config_path=(config_path) ⇒ Object



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

def config_path=(config_path)
  @config_path = config_path
end

.envObject



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

def env
  @env || ENV["HOTH_ENV"] || (Object.const_defined?("Rails") ? Rails.env.to_sym : :development)
end

.env=(env) ⇒ Object



57
58
59
# File 'lib/hoth.rb', line 57

def env=(env)
  @env = env.to_sym
end

.init!Object



26
27
28
29
30
31
# File 'lib/hoth.rb', line 26

def init!
  load_service_definition
  load_module_definition
  Logger.init_logging!
  @client_uuid = Digest::SHA1.hexdigest("Time.now--#{rand()}")
end

.load_module_definitionObject



49
50
51
# File 'lib/hoth.rb', line 49

def load_module_definition
  require File.join(config_path, "module_definition")
end

.load_service_definitionObject



45
46
47
# File 'lib/hoth.rb', line 45

def load_service_definition
  require File.join(config_path, "service_definition")
end