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.



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

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

Instance Attribute Details

#callback ⇒ Object

Returns the value of attribute callback.



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

def callback
  @callback
end

#definition ⇒ Object

Returns the value of attribute definition.



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

def definition
  @definition
end

#instance_id ⇒ Object

Returns the value of attribute instance_id.



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

def instance_id
  @instance_id
end

Instance Method Details

#debug(message) ⇒ Object



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

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

#error(message) ⇒ Object



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

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

#id ⇒ Object



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

def id
  @definition.id
end

#info(message) ⇒ Object



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

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

#log(status, message) ⇒ Object



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

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

#respond(params) ⇒ Object



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

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

#warn(message) ⇒ Object



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

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