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.



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

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

Instance Attribute Details

#callback ⇒ Object

Returns the value of attribute callback.



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

def callback
  @callback
end

#definition ⇒ Object

Returns the value of attribute definition.



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

def definition
  @definition
end

#instance_id ⇒ Object

Returns the value of attribute instance_id.



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

def instance_id
  @instance_id
end

Instance Method Details

#debug(message) ⇒ Object



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

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

#error(message) ⇒ Object



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

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

#id ⇒ Object



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

def id
  @definition.id
end

#info(message) ⇒ Object



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

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

#log(status, message) ⇒ Object



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

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

#respond(params) ⇒ Object



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

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

#warn(message) ⇒ Object



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

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