Class: App42::Storage::Query
- Inherits:
-
App42Response
- Object
- App42Response
- App42::Storage::Query
- Defined in:
- lib/storage/Query.rb
Instance Attribute Summary collapse
-
#jsonArray ⇒ Object
Returns the value of attribute jsonArray.
-
#jsonObject ⇒ Object
Returns the value of attribute jsonObject.
Attributes inherited from App42Response
#isResponseSuccess, #strResponse, #totalRecords
Instance Method Summary collapse
- #getStr ⇒ Object
- #getType ⇒ Object
-
#initialize(jsonQuery) ⇒ Query
constructor
A new instance of Query.
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
#jsonArray ⇒ Object
Returns the value of attribute jsonArray.
11 12 13 |
# File 'lib/storage/Query.rb', line 11 def jsonArray @jsonArray end |
#jsonObject ⇒ Object
Returns the value of attribute jsonObject.
11 12 13 |
# File 'lib/storage/Query.rb', line 11 def jsonObject @jsonObject end |
Instance Method Details
#getStr ⇒ Object
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 |
#getType ⇒ Object
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 |