Module: Jackal

Defined in:
lib/jackal.rb,
lib/jackal/error.rb,
lib/jackal/utils.rb,
lib/jackal/loader.rb,
lib/jackal/version.rb,
lib/jackal/callback.rb,
lib/jackal/formatter.rb,
lib/jackal/utils/spec.rb,
lib/jackal/utils/config.rb,
lib/jackal/utils/events.rb,
lib/jackal/utils/payload.rb,
lib/jackal/utils/process.rb,
lib/jackal/utils/http_api.rb,
lib/jackal/utils/constants.rb,
lib/jackal/utils/spec/generator.rb,
lib/jackal/utils/spec/callback_local.rb

Defined Under Namespace

Modules: Utils Classes: Callback, Error, Formatter, Loader, ServiceInformation

Constant Summary collapse

VERSION =

Current library version

Gem::Version.new('0.5.0')

Class Method Summary collapse

Class Method Details

.service(name, args = {}) ⇒ NilClass

Add service information

Parameters:

  • name (String, Symbol)

    name of service

  • args (Hash) (defaults to: {})

    service information

Options Hash (args):

  • :description (String)
  • :configuration (Hash)

Returns:

  • (NilClass)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/jackal.rb', line 38

def self.service(name, args={})
  name = name.to_s
  if(@services[name])
    new_config = ServiceInformation.new(args.merge(:name => name))
    @services[name] = ServiceInformation.new(
      @services[name].data.merge(
        :configuration => (
          @services[name].data[:configuration] |
          new_config.data[:configuration]
        )
      )
    )
  else
    @services[name] = ServiceInformation.new(args.merge(:name => name))
  end
  nil
end

.service_infoSmash

Returns registered service info.

Returns:

  • (Smash)

    registered service info



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

def self.service_info
  @services.to_smash
end