Class: FSR::App::UuidSetVar

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

Constant Summary collapse

SENDMSG_METHOD =
%q|
  def uuid_setvar(*args, &block)
    me = super(*args)
    api_call = "api uuid_setvar #{me.uuid} #{me.var} #{me.assignment}\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, assignment) ⇒ UuidSetVar

Returns a new instance of UuidSetVar.



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

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

Instance Attribute Details

#assignmentObject (readonly)

Returns the value of attribute assignment.



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

def assignment
  @assignment
end

#uuidObject (readonly)

Returns the value of attribute uuid.



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

def uuid
  @uuid
end

#varObject (readonly)

Returns the value of attribute var.



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

def var
  @var
end

Instance Method Details

#argumentsObject



14
15
16
# File 'lib/fsr/app/uuid_setvar.rb', line 14

def arguments
  [@uuid, @var, @assignment]
end

#sendmsgObject



18
19
20
# File 'lib/fsr/app/uuid_setvar.rb', line 18

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