Class: XRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-extjs-direct/xrequest.rb

Overview

XRequest A standard response class suitable for Ext.Direct requests.

Author:

  • Chris Scott

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ XRequest

Returns a new instance of XRequest.



9
10
11
12
13
14
15
16
# File 'lib/rails-extjs-direct/xrequest.rb', line 9

def initialize(params)
    # TODO: simply setting @id, @params
    @tid        = params["tid"]
    @type       = params["type"]
    @params     = (params["data"].kind_of?(Array)) ? params["data"].first : {}
    @controller = params["xcontroller"]
    @action     = params["xaction"]
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def action
  @action
end

#controllerObject (readonly)

Returns the value of attribute controller.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def controller
  @controller
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def id
  @id
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def params
  @params
end

#tidObject (readonly)

Returns the value of attribute tid.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def tid
  @tid
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/rails-extjs-direct/xrequest.rb', line 7

def type
  @type
end