Class: FSR::App::UuidGetVar

Inherits:
Application show all
Defined in:
lib/fsr/app/uuid_getvar.rb

Constant Summary collapse

SENDMSG_METHOD =
%q|
  def uuid_getvar(*args, &block)
    me = super(*args)
    @uuid_var = me.var
    api_call = "api uuid_getvar #{me.uuid} #{me.var}\n\n"
    send_data(api_call) 
    @queue.unshift block if block_given?
  end
|

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Application

#app_name, #raw, #to_s

Constructor Details

#initialize(uuid, var) ⇒ UuidGetVar

Returns a new instance of UuidGetVar.



8
9
10
11
# File 'lib/fsr/app/uuid_getvar.rb', line 8

def initialize(uuid, var)
  @uuid = uuid # Unique channel ID
  @var = var # Channel variable you wish to 'set'
end

Instance Attribute Details

#uuidObject (readonly)

Returns the value of attribute uuid.



6
7
8
# File 'lib/fsr/app/uuid_getvar.rb', line 6

def uuid
  @uuid
end

#varObject (readonly)

Returns the value of attribute var.



6
7
8
# File 'lib/fsr/app/uuid_getvar.rb', line 6

def var
  @var
end

Instance Method Details

#argumentsObject



13
14
15
# File 'lib/fsr/app/uuid_getvar.rb', line 13

def arguments
  [@uuid, @var]
end

#sendmsgObject



17
18
19
# File 'lib/fsr/app/uuid_getvar.rb', line 17

def sendmsg
  "call-command: execute\nexecute-app-name: %s\nexecute-app-arg: %s\nevent-lock:true\n\n" % [app_name, arguments.join(" ")]
end