Class: SmartfoxJruby::SfsWorker::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/smartfox_jruby/sfs_worker.rb

Direct Known Subclasses

Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, data = {}) ⇒ Request

Returns a new instance of Request.



67
68
69
70
# File 'lib/smartfox_jruby/sfs_worker.rb', line 67

def initialize(name, data = {})
  @name = name
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



65
66
67
# File 'lib/smartfox_jruby/sfs_worker.rb', line 65

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



64
65
66
# File 'lib/smartfox_jruby/sfs_worker.rb', line 64

def name
  @name
end

Instance Method Details

#to_extension_requestObject



72
73
74
# File 'lib/smartfox_jruby/sfs_worker.rb', line 72

def to_extension_request
  ExtensionRequest.new(@name.to_s, @data)
end

#to_sObject



76
77
78
# File 'lib/smartfox_jruby/sfs_worker.rb', line 76

def to_s
  "Req[#{@name}]#{data.to_json}"
end