Class: App42::Storage::Query

Inherits:
App42Response show all
Defined in:
lib/storage/Query.rb

Instance Attribute Summary collapse

Attributes inherited from App42Response

#isResponseSuccess, #strResponse, #totalRecords

Instance Method Summary collapse

Constructor Details

#initialize(jsonQuery) ⇒ Query

Returns a new instance of Query.



14
15
16
17
18
19
20
# File 'lib/storage/Query.rb', line 14

def initialize(jsonQuery)
  if jsonQuery.kind_of?(Hash)
    self.jsonObject = jsonQuery;
  else
    self.jsonArray = jsonQuery;
  end
end

Instance Attribute Details

#jsonArrayObject

Returns the value of attribute jsonArray.



11
12
13
# File 'lib/storage/Query.rb', line 11

def jsonArray
  @jsonArray
end

#jsonObjectObject

Returns the value of attribute jsonObject.



11
12
13
# File 'lib/storage/Query.rb', line 11

def jsonObject
  @jsonObject
end

Instance Method Details

#getStrObject



22
23
24
25
26
27
28
# File 'lib/storage/Query.rb', line 22

def getStr
  if (jsonObject != nil)
    return "["+jsonObject.to_s()+"]"
  else
    return jsonArray.to_s()
  end
end

#getTypeObject



30
31
32
33
34
35
36
# File 'lib/storage/Query.rb', line 30

def getType
  if (jsonObject != nil)
    return jsonObject
  else
    return jsonArray
  end
end