Class: Opener::Outlet

Inherits:
Object
  • Object
show all
Defined in:
lib/opener/outlet.rb,
lib/opener/outlet/output.rb,
lib/opener/outlet/server.rb,
lib/opener/outlet/version.rb

Defined Under Namespace

Classes: Output, Server

Constant Summary collapse

VERSION =
'2.0.1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Outlet

Returns a new instance of Outlet.



20
21
22
# File 'lib/opener/outlet.rb', line 20

def initialize(options = {})
  @uuid = options[:request_id] || SecureRandom.hex
end

Instance Attribute Details

#uuidObject (readonly)

Returns the value of attribute uuid.



18
19
20
# File 'lib/opener/outlet.rb', line 18

def uuid
  @uuid
end

Instance Method Details

#run(input) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/opener/outlet.rb', line 24

def run(input)
  output = Output.new(:uuid=>uuid, :text=>input)

  output.save!

  return input
end