Parent

Namespace

Class/Module Index [+]

Quicksearch

KMTS

Constants

VERSION

Public Class Methods

alias(name, alias_to) click to toggle source
# File lib/km.rb, line 67
def alias(name, alias_to)
  begin
    return unless is_initialized?
    generate_query('a', { '_n' => alias_to, '_p' => name }, false)
  rescue Exception => e
    log_error(e)
  end
end
host() click to toggle source
# File lib/km.rb, line 110
def host
  @host
end
identify(id) click to toggle source
# File lib/km.rb, line 50
def identify(id)
  @id = id
end
init(key, options={}) click to toggle source
# File lib/km.rb, line 30
def init(key, options={})
  default = {
    :host      => @host,
    :log_dir   => @log_dir,
    :to_stderr => @to_stderr,
    :use_cron  => @use_cron
  }
  options.reverse_merge!(default)
  begin
    @key       = key
    @host      = options[:host]
    @log_dir   = options[:log_dir]
    @use_cron  = options[:use_cron]
    @to_stderr = options[:to_stderr]
    log_dir_writable?
  rescue Exception => e
    log_error(e)
  end
end
log_dir() click to toggle source
# File lib/km.rb, line 107
def log_dir
  @log_dir
end
record(action,props={}) click to toggle source
# File lib/km.rb, line 54
def record(action,props={})
  props = hash_keys_to_str(props)
  begin
    return unless is_initialized_and_identified?
    return set(action) if action.class == Hash

    props.update('_n' => action)
    generate_query('e', props)
  rescue Exception => e
    log_error(e)
  end
end
set(data) click to toggle source
# File lib/km.rb, line 76
def set(data)
  begin
    return unless is_initialized_and_identified?
    generate_query('s', data)
  rescue Exception => e
    log_error(e)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.