class HerdstServicecall::Configurator

Public Class Methods

new() click to toggle source
# File lib/herdst_servicecall/configurator.rb, line 5
def initialize
    @config = Hash.new.with_indifferent_access
    @config[:services] = Hash.new
    @config[:events] = Hash.new
    @config[:event_path] = "/servicecall/event"
    @config[:jwt_secret] = nil
    @config[:jwt_algorithm] = "HS256"
end

Public Instance Methods

get_service(name) click to toggle source
# File lib/herdst_servicecall/configurator.rb, line 20
def get_service(name)
    @config[:services][name.to_sym]
end
method_missing(method, *args) click to toggle source
# File lib/herdst_servicecall/configurator.rb, line 30
def method_missing(method, *args)
    if (args.size == 1)
        @config[method.to_sym] = args.first
    else
        @config[method.to_sym]
    end
end
on(event_name, action) click to toggle source
# File lib/herdst_servicecall/configurator.rb, line 25
def on(event_name, action)
    @config[:events][event_name.to_sym] = action
end
register_service(name, endpoint) click to toggle source
# File lib/herdst_servicecall/configurator.rb, line 15
def register_service(name, endpoint)
    @config[:services][name.to_sym] = endpoint
end