Class: Factor::Connector::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/instances/instance.rb

Direct Known Subclasses

ActionInstance, ListenerInstance, ServiceInstance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Instance

Returns a new instance of Instance.



16
17
18
# File 'lib/instances/instance.rb', line 16

def initialize(options = {})
  @definition = options[:definition] if options[:definition]
end

Instance Attribute Details

#callback ⇒ Object

Returns the value of attribute callback.



14
15
16
# File 'lib/instances/instance.rb', line 14

def callback
  @callback
end

#definition ⇒ Object

Returns the value of attribute definition.



14
15
16
# File 'lib/instances/instance.rb', line 14

def definition
  @definition
end

#instance_id ⇒ Object

Returns the value of attribute instance_id.



14
15
16
# File 'lib/instances/instance.rb', line 14

def instance_id
  @instance_id
end

Instance Method Details

#debug(message) ⇒ Object



44
45
46
# File 'lib/instances/instance.rb', line 44

def debug(message)
  log 'debug', message
end

#error(message) ⇒ Object



36
37
38
# File 'lib/instances/instance.rb', line 36

def error(message)
  log 'error', message
end

#id ⇒ Object



28
29
30
# File 'lib/instances/instance.rb', line 28

def id
  @definition.id
end

#info(message) ⇒ Object



32
33
34
# File 'lib/instances/instance.rb', line 32

def info(message)
  log 'info', message
end

#log(status, message) ⇒ Object



48
49
50
# File 'lib/instances/instance.rb', line 48

def log(status, message)
  respond type: 'log', status: status, message: message
end

#respond(params) ⇒ Object



24
25
26
# File 'lib/instances/instance.rb', line 24

def respond(params)
  @callback.call(params) if @callback
end

#warn(message) ⇒ Object



40
41
42
# File 'lib/instances/instance.rb', line 40

def warn(message)
  log 'warn', message
end