Class: FSR::App::Bridge
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Application
#app_name, #sendmsg, #to_s
Constructor Details
#initialize(target, opts = {}) ⇒ Bridge
Returns a new instance of Bridge.
8
9
10
11
12
|
# File 'lib/fsr/app/bridge.rb', line 8
def initialize(target, opts = {})
@target = target
@options = opts || {}
end
|
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
6
7
8
|
# File 'lib/fsr/app/bridge.rb', line 6
def options
@options
end
|
Class Method Details
.execute(target, opts = {}) ⇒ Object
26
27
28
|
# File 'lib/fsr/app/bridge.rb', line 26
def self.execute(target, opts = {})
self.new(target, opts).raw
end
|
Instance Method Details
#arguments ⇒ Object
14
15
16
|
# File 'lib/fsr/app/bridge.rb', line 14
def arguments
[@target]
end
|
#modifiers ⇒ Object
18
19
20
|
# File 'lib/fsr/app/bridge.rb', line 18
def modifiers
@options.map { |k,v| "%s=%s" % [k, v] }.join(",")
end
|
#raw ⇒ Object
22
23
24
|
# File 'lib/fsr/app/bridge.rb', line 22
def raw
"%s({%s}%s)" % [app_name, modifiers, arguments.join(" ")]
end
|