Class: DSRequest

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

Overview

<summary>

   reference to the RPCManager executing this request will be stored in DSRequest.
   This has to be done because, while the request is being.executed, access will be required to various items such as 
   the DataSource object, etc - These items will all be provided by the RPCManager class.
</summary>

Constant Summary collapse

@@obj =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, model) ⇒ DSRequest



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/DSRequest.rb', line 23

def initialize(data, model)
  @componentId = data[:componentId]
  @dataSource = data[:dataSource]
  @operationType = data[:operationType]
  @startRow = data[:startRow]
  @endRow = data[:endRow]
  @textMatchStyle = data[:textMatchStyle]
  @data = data[:data]
  @sortBy = data[:sortBy]
  @oldValues = data[:oldValues]
  
  @@obj = model
end

Instance Attribute Details

#advancedCriteriaObject

Returns the value of attribute advancedCriteria.



10
11
12
# File 'lib/DSRequest.rb', line 10

def advancedCriteria
  @advancedCriteria
end

#dataObject

Returns the value of attribute data.



10
11
12
# File 'lib/DSRequest.rb', line 10

def data
  @data
end

#dataSourceObject

Returns the value of attribute dataSource.



10
11
12
# File 'lib/DSRequest.rb', line 10

def dataSource
  @dataSource
end

#endRowObject

Returns the value of attribute endRow.



10
11
12
# File 'lib/DSRequest.rb', line 10

def endRow
  @endRow
end

#oldValuesObject

Returns the value of attribute oldValues.



10
11
12
# File 'lib/DSRequest.rb', line 10

def oldValues
  @oldValues
end

#operationTypeObject

Returns the value of attribute operationType.



10
11
12
# File 'lib/DSRequest.rb', line 10

def operationType
  @operationType
end

#sortByObject

Returns the value of attribute sortBy.



10
11
12
# File 'lib/DSRequest.rb', line 10

def sortBy
  @sortBy
end

#startRowObject

Returns the value of attribute startRow.



10
11
12
# File 'lib/DSRequest.rb', line 10

def startRow
  @startRow
end

#textMatchStyleObject

Returns the value of attribute textMatchStyle.



10
11
12
# File 'lib/DSRequest.rb', line 10

def textMatchStyle
  @textMatchStyle
end

Instance Method Details

#executeObject

<summary>

  The execute() method itself only loads the DataSource object then calls the DataSource's execute method for 
  processing the request.
</summary>
  <params>
    @datasource: DataSource object from the RPCManager helper class
    @@obj: model object that is mapped to the table
  </params>


46
47
48
49
50
51
52
53
# File 'lib/DSRequest.rb', line 46

def execute
  ds = DataSource.new(@dataSource, @@obj)
  if ds.nil?
    return nil
  else
    return ds.execute(self)
  end
end