Class: Lazylead::ORM::System

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Lazylead::ORM
Defined in:
lib/lazylead/model.rb

Overview

Ticketing systems to monitor.

Instance Method Summary collapse

Methods included from Lazylead::ORM

#env, #inspect, #to_h?, #to_hash, #to_s

Instance Method Details

#connect(log = Log.new) ⇒ Object

Make an instance of ticketing system for future interaction.



205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/lazylead/model.rb', line 205

def connect(log = Log.new)
  opts = to_hash
  if opts["type"].empty?
    log.warn "No task system details provided, an empty stub is used."
    Empty.new
  else
    opts["type"].constantize.new(
      env(opts.except("type", "salt")),
      opts["salt"].blank? ? NoSalt.new : Salt.new(opts["salt"])
    )
  end
end