Module: FFWD::Plugin::JSON
- Includes:
- Logging, FFWD::Plugin
- Defined in:
- lib/ffwd/plugin/json.rb,
lib/ffwd/plugin/json/connection.rb
Defined Under Namespace
Modules: Connection Classes: FrameConnection, LineConnection
Constant Summary collapse
- DEFAULT_HOST =
"localhost"- DEFAULT_PORT =
19000- DEFAULT_PROTOCOL =
"tcp"- DEFAULT_KIND =
"line"- KINDS =
{"frame" => FrameConnection, "line" => LineConnection}
Class Method Summary collapse
Methods included from Logging
Methods included from FFWD::Plugin
category, discovered, included, load_discovered, load_plugins, loaded, option
Class Method Details
.setup_input(opts, core) ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/ffwd/plugin/json.rb', line 82 def self.setup_input opts, core protocol = FFWD.parse_protocol opts[:protocol] || DEFAULT_PROTOCOL kind = (opts[:kind] || DEFAULT_KIND).to_s raise "No such kind: #{kind}" unless connection = KINDS[kind] opts[:host] ||= DEFAULT_HOST opts[:port] ||= DEFAULT_PORT protocol.bind opts, core, log, connection end |
.setup_tunnel(opts, core, tunnel) ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/ffwd/plugin/json.rb', line 91 def self.setup_tunnel opts, core, tunnel protocol = FFWD.parse_protocol opts[:protocol] || "tcp" kind = (opts[:kind] || DEFAULT_KIND).to_s raise "No such kind: #{kind}" unless connection = KINDS[kind] opts[:port] ||= DEFAULT_PORT protocol.tunnel opts, core, tunnel, log, connection end |