AvrijAnalyticsUtility 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 162727047ff2b221c5ba3457c1ae3b910fbf0f55
4
- data.tar.gz: 53c2f2f3ea65e795a941fff9a2011e3a3aaefe03
3
+ metadata.gz: aab9192789eb38e11eb704e50bf351463f4d6c16
4
+ data.tar.gz: fcda45fe80bb58f15338f5ebf536cd894e43ad7e
5
5
  SHA512:
6
- metadata.gz: 034c16d66f7a02b3f73cc33457b258c56a3df1a00baad800cfe193c665f4ace11662b60e795ac1a88929b4af442e5eba9ddd35b712db75454eea00effc51eaeb
7
- data.tar.gz: faf3bdc96f45c9a688bce4514b09e4804213fe493e6044d989d40ddff0a91f6920c02494a58dad0abcb9675976fc99d11015ecd0abb9c78280947cfb1ef1631e
6
+ metadata.gz: 8c928c42649bf558c00c9913a27c73cc3e53a5b174c689d4132b0e18af3f0c579ab57516a00693b2ea65a440d233be922f9b4c7b35464218e2973fc66df578b8
7
+ data.tar.gz: 36a6a49d06a40b8f24dad01999ead3b58405b657dfe1371793fe3809258a59d1e40c17c1cff10cbb54cce548b1f8e58089b0deb2c383d8bdaa9e717c29825232
@@ -33,22 +33,22 @@ class AvrijAnalyticsUtility::APIConnector
33
33
  # * +queryHash+ - Hash definition of query options
34
34
  # ==== Examples
35
35
  #
36
- # [apiEndpoint]
37
- # - Given the complete browser's uri : https://www.company.com:8080/api/endpoint1/endpoint1_1
38
- # - given the base uri : https://www.company.com:8080
39
- # - then endpoint is : api/endpoint1/endpoint1_1
40
- #
41
- # [headerHash]
42
- # - my_header: {
43
- # "Key1" => "value1",
44
- # "key2" => "value2"
45
- # }
46
- #
47
- # [headerQuery]
48
- # - my_query {
49
- # "key1" => "value1",
50
- # "key2" => "value2"
51
- # }
36
+ # #[apiEndpoint]
37
+ # #- Given the complete browser's uri : https://www.company.com:8080/api/endpoint1/endpoint1_1
38
+ # #- given the base uri : https://www.company.com:8080
39
+ # #- then endpoint is : api/endpoint1/endpoint1_1
40
+ #
41
+ # #[headerHash]
42
+ # #- my_header: {
43
+ # # "Key1" => "value1",
44
+ # # "key2" => "value2"
45
+ # # }
46
+ #
47
+ # #[headerQuery]
48
+ # #- my_query {
49
+ # # "key1" => "value1",
50
+ # # "key2" => "value2"
51
+ # #}
52
52
  def getRequest(apiEndpoint,headerHash,queryHash)
53
53
  @header_hash = headerHash
54
54
  @query_hash = queryHash
@@ -64,11 +64,11 @@ class AvrijAnalyticsUtility::APIConnector
64
64
  # * +headerHash+ - Hash definition of header options
65
65
  # ==== Examples
66
66
  #
67
- # [headerHash]
68
- # - my_header: {
69
- # "Key1" => "value1",
70
- # "key2" => "value2"
71
- # }
67
+ # #[headerHash]
68
+ # #- my_header: {
69
+ # # "Key1" => "value1",
70
+ # # "key2" => "value2"
71
+ # # }
72
72
  def setHeader(headerHash)
73
73
  @header_hash = headerHash
74
74
  end
@@ -79,11 +79,11 @@ class AvrijAnalyticsUtility::APIConnector
79
79
  # * +queryHash+ - Hash definition of query options
80
80
  # ==== Examples
81
81
  #
82
- # [queryHash]
83
- # - my_query: {
84
- # "Key1" => "value1",
85
- # "key2" => "value2"
86
- # }
82
+ # #[queryHash]
83
+ # #- my_query: {
84
+ # # "Key1" => "value1",
85
+ # # "key2" => "value2"
86
+ # # }
87
87
  def setQuery(queryHash)
88
88
  @query_hash = queryHash
89
89
  end
@@ -94,11 +94,11 @@ class AvrijAnalyticsUtility::APIConnector
94
94
  # * +bodyHash+ - Hash definition of body options
95
95
  # ==== Examples
96
96
  #
97
- # [bodyHash]
98
- # - my_body: {
99
- # "Key1" => "value1",
100
- # "key2" => "value2"
101
- # }
97
+ # #[bodyHash]
98
+ # #- my_body: {
99
+ # # "Key1" => "value1",
100
+ # # "key2" => "value2"
101
+ # # }
102
102
  def setBody(bodyHash)
103
103
  @body_hash = bodyHash
104
104
  end
@@ -115,22 +115,22 @@ class AvrijAnalyticsUtility::APIConnector
115
115
  #
116
116
  # ==== Steps for Authentication
117
117
  #
118
- # myConnector = APIConnector.new(base_uri)
118
+ # #myConnector = APIConnector.new(base_uri)
119
119
  #
120
- # auth_Header = \{
121
- # "Authorization" => "Bearer undefined"
122
- # \}
120
+ # #auth_Header = {
121
+ # # "Authorization" => "Bearer undefined"
122
+ # #}
123
123
  #
124
- # auth_body = \{
125
- # "username" => "myusername",
126
- # "password" => "mypassword"
127
- # \}
124
+ # #auth_body = {
125
+ # # "username" => "myusername",
126
+ # # "password" => "mypassword"
127
+ # #}
128
128
  #
129
- # myConnector.setHeader(auth_Header)
130
- # myConnector.setBody(auth_body)
131
- # if myConnector.authenticate(auth_endpoint)
132
- # <todo>
133
- # end
129
+ # #myConnector.setHeader(auth_Header)
130
+ # #myConnector.setBody(auth_body)
131
+ # #if myConnector.authenticate(auth_endpoint)
132
+ # # <todo>
133
+ # #end
134
134
 
135
135
  def authenticate(authentication_endpoint)
136
136
  authentication_uri = @base_uri + "/" + authentication_endpoint
@@ -148,4 +148,19 @@ class AvrijAnalyticsUtility::APIConnector
148
148
  end
149
149
  return result
150
150
  end
151
+
152
+ # Send JSON string to JSON file
153
+ #
154
+ # ==== Attributes
155
+ #
156
+ # * +jsonString+ - JSON string
157
+ # * +jsonOutputFile+ - JSON output file
158
+ #
159
+ def jsonString_to_jsonFile(jsonString,jsonOutputFile)
160
+ File.open(jsonOutputFile,"w") do |f|
161
+ f.write(jsonString.to_json)
162
+ end
163
+ end
164
+
165
+
151
166
  end # end- APIConnector
@@ -1,3 +1,3 @@
1
1
  module AvrijAnalyticsUtility
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AvrijAnalyticsUtility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dalisay
@@ -128,7 +128,7 @@ licenses:
128
128
  - MIT
129
129
  metadata:
130
130
  allowed_push_host: https://rubygems.org
131
- post_install_message: 'AvrijAnalyticsUtility VERSION : 0.5.2'
131
+ post_install_message: 'AvrijAnalyticsUtility VERSION : 0.5.3'
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib