myask 0.0.1 → 1.0.0

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/bin/myask +1 -1
  4. data/html/App.html +116 -0
  5. data/html/MyAsk/Api/Helper.html +207 -0
  6. data/html/MyAsk/Api/Invitation.html +212 -0
  7. data/html/MyAsk/Api/Project.html +355 -0
  8. data/html/MyAsk/Api/ProjectHelper.html +299 -0
  9. data/html/MyAsk/Api/Question.html +261 -0
  10. data/html/MyAsk/Api.html +120 -0
  11. data/html/MyAsk/Config.html +195 -0
  12. data/html/MyAsk/ConfigHelper.html +251 -0
  13. data/html/MyAsk/Prompt.html +221 -0
  14. data/html/MyAsk/PromptHelper.html +330 -0
  15. data/html/MyAsk.html +114 -0
  16. data/html/README_rdoc.html +394 -0
  17. data/html/created.rid +14 -0
  18. data/html/css/fonts.css +167 -0
  19. data/html/css/rdoc.css +681 -0
  20. data/html/fonts/Lato-Light.ttf +0 -0
  21. data/html/fonts/Lato-LightItalic.ttf +0 -0
  22. data/html/fonts/Lato-Regular.ttf +0 -0
  23. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  24. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  25. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  26. data/html/images/add.png +0 -0
  27. data/html/images/arrow_up.png +0 -0
  28. data/html/images/brick.png +0 -0
  29. data/html/images/brick_link.png +0 -0
  30. data/html/images/bug.png +0 -0
  31. data/html/images/bullet_black.png +0 -0
  32. data/html/images/bullet_toggle_minus.png +0 -0
  33. data/html/images/bullet_toggle_plus.png +0 -0
  34. data/html/images/date.png +0 -0
  35. data/html/images/delete.png +0 -0
  36. data/html/images/find.png +0 -0
  37. data/html/images/loadingAnimation.gif +0 -0
  38. data/html/images/macFFBgHack.png +0 -0
  39. data/html/images/package.png +0 -0
  40. data/html/images/page_green.png +0 -0
  41. data/html/images/page_white_text.png +0 -0
  42. data/html/images/page_white_width.png +0 -0
  43. data/html/images/plugin.png +0 -0
  44. data/html/images/ruby.png +0 -0
  45. data/html/images/tag_blue.png +0 -0
  46. data/html/images/tag_green.png +0 -0
  47. data/html/images/transparent.png +0 -0
  48. data/html/images/wrench.png +0 -0
  49. data/html/images/wrench_orange.png +0 -0
  50. data/html/images/zoom.png +0 -0
  51. data/html/index.html +403 -0
  52. data/html/js/darkfish.js +120 -0
  53. data/html/js/navigation.js +105 -0
  54. data/html/js/navigation.js.gz +0 -0
  55. data/html/js/search.js +110 -0
  56. data/html/js/search_index.js +1 -0
  57. data/html/js/search_index.js.gz +0 -0
  58. data/html/js/searcher.js +229 -0
  59. data/html/js/searcher.js.gz +0 -0
  60. data/html/table_of_contents.html +257 -0
  61. data/lib/myask/version.rb +1 -1
  62. data/pkg/myask-0.0.1/Gemfile +10 -0
  63. data/pkg/myask-0.0.1/Gemfile.lock +70 -0
  64. data/pkg/myask-0.0.1/README.rdoc +6 -0
  65. data/pkg/myask-0.0.1/Rakefile +21 -0
  66. data/pkg/myask-0.0.1/bin/myask +101 -0
  67. data/pkg/myask-0.0.1/lib/myask/api/api_helper.rb +45 -0
  68. data/pkg/myask-0.0.1/lib/myask/api/invitation.rb +49 -0
  69. data/pkg/myask-0.0.1/lib/myask/api/project.rb +193 -0
  70. data/pkg/myask-0.0.1/lib/myask/api/project_helper.rb +46 -0
  71. data/pkg/myask-0.0.1/lib/myask/api/question.rb +99 -0
  72. data/pkg/myask-0.0.1/lib/myask/config.rb +37 -0
  73. data/pkg/myask-0.0.1/lib/myask/config_helper.rb +28 -0
  74. data/pkg/myask-0.0.1/lib/myask/prompt.rb +63 -0
  75. data/pkg/myask-0.0.1/lib/myask/prompt_helper.rb +80 -0
  76. data/pkg/myask-0.0.1/lib/myask/version.rb +3 -0
  77. data/pkg/myask-0.0.1/lib/myask.rb +28 -0
  78. data/pkg/myask-0.0.1/myask.gemspec +22 -0
  79. data/pkg/myask-0.0.1/myask.rdoc +138 -0
  80. data/pkg/myask-0.0.1/test/default_test.rb +14 -0
  81. data/pkg/myask-0.0.1/test/test_helper.rb +4 -0
  82. data/pkg/myask-0.0.1.gem +0 -0
  83. metadata +79 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 006a91a281c01fdcecea19680a9d7af0b289f1e4f2caedeefd8b7f2619bf7cfc
4
- data.tar.gz: b626f02eda6131712e88acc76c0fa21a600e2e3c0657a6d7461506c461017f38
3
+ metadata.gz: cc3caee60e902b2c8700ce1acb4c5c10d5171c851028b079a10241820e7cf51e
4
+ data.tar.gz: 88d6ca39a162d0affe27f3dbbfa8f85c73d1dea61f2751eb9f661e5af6bff2c5
5
5
  SHA512:
6
- metadata.gz: b16d43f1e3877f7e925cbcdac03002863ad444d41f6d99edc4d4517a319138daaf76801c73a0aad94c8269ae256ff6bcde3d0db26a42717f10b65469e04a81c5
7
- data.tar.gz: 361cb8182fca17368f3d60f2fa06e4b5449994fac7b695d9f52c4f2218295d899832fd03d060bcf23451b1ece43aa21103b12e2cc2b6c34e14161be425a19071
6
+ metadata.gz: 285e65b22a9cdc8866ca3f56dc466bb72ad9ba9addce2ed46215d35e977645dd8ae252e351a78152ca78bdc5fd7fb36df6c1aef5de5c96d41e21ae535e4fba40
7
+ data.tar.gz: 78771907c03e8eb8d67aa708d1c651316f10053713c71c67e7c5b2b2f4b60c877bd921eb68aaa97872d43794d9c1b92f75738bb94f700d2cd9f99381617ce321
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- myask (0.0.1)
4
+ myask (1.0.0)
5
5
  gli (~> 2.22.2)
6
6
 
7
7
  GEM
data/bin/myask CHANGED
@@ -92,7 +92,7 @@ class App
92
92
  abort "API Error: #{exception}"
93
93
  else # RuntimeError
94
94
  puts exception.backtrace
95
- binding.pry
95
+ # binding.pry
96
96
  end
97
97
  false # false to skip default error handling
98
98
  end
data/html/App.html ADDED
@@ -0,0 +1,116 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ <title>class App - Your application title</title>
9
+
10
+ <meta name="keywords" content="ruby,class,App">
11
+
12
+ <meta name="description" content="Documentation for the App class">
13
+
14
+ <script type="text/javascript">
15
+ var rdoc_rel_prefix = "./";
16
+ var index_rel_prefix = "./";
17
+ </script>
18
+
19
+ <script src="./js/navigation.js" defer></script>
20
+ <script src="./js/search.js" defer></script>
21
+ <script src="./js/search_index.js" defer></script>
22
+ <script src="./js/searcher.js" defer></script>
23
+ <script src="./js/darkfish.js" defer></script>
24
+
25
+ <link href="./css/fonts.css" rel="stylesheet">
26
+ <link href="./css/rdoc.css" rel="stylesheet">
27
+
28
+
29
+ <body id="top" role="document" class="class">
30
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
31
+ <span aria-hidden="true">&#9776;</span>
32
+ </div>
33
+
34
+
35
+ <nav id="navigation" role="navigation">
36
+ <div id="project-navigation">
37
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
38
+ <h2>
39
+ <a href="./index.html" rel="home">Home</a>
40
+ </h2>
41
+
42
+ <div id="table-of-contents-navigation">
43
+ <a href="./table_of_contents.html#pages">Pages</a>
44
+ <a href="./table_of_contents.html#classes">Classes</a>
45
+ <a href="./table_of_contents.html#methods">Methods</a>
46
+ </div>
47
+ </div>
48
+
49
+ <div id="search-section" role="search" class="project-section initially-hidden">
50
+ <form action="#" method="get" accept-charset="utf-8">
51
+ <div id="search-field-wrapper">
52
+ <input id="search-field" role="combobox" aria-label="Search"
53
+ aria-autocomplete="list" aria-controls="search-results"
54
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
55
+ title="Type to search, Up and Down to navigate, Enter to load">
56
+ </div>
57
+
58
+ <ul id="search-results" aria-label="Search Results"
59
+ aria-busy="false" aria-expanded="false"
60
+ aria-atomic="false" class="initially-hidden"></ul>
61
+ </form>
62
+ </div>
63
+
64
+ </div>
65
+
66
+
67
+
68
+ <div id="parent-class-section" class="nav-section">
69
+ <h3>Ancestors</h3>
70
+ <ul><li>Object</li></ul>
71
+ </div>
72
+
73
+
74
+
75
+ <div id="extends-section" class="nav-section">
76
+ <h3>Extended With Modules</h3>
77
+
78
+ <ul class="link-list">
79
+ <li><span class="extend">GLI::App</span>
80
+ </ul>
81
+ </div>
82
+
83
+
84
+
85
+
86
+
87
+
88
+ <footer id="validator-badges" role="contentinfo">
89
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
90
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.13.0.
91
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
92
+ </footer>
93
+
94
+ </nav>
95
+
96
+ <main role="main" aria-labelledby="class-App">
97
+
98
+
99
+
100
+ <h1 id="class-App" class="anchor-link class">
101
+ class App
102
+ </h1>
103
+
104
+ <section class="description">
105
+
106
+ </section>
107
+
108
+ <section id="5Buntitled-5D" class="documentation-section anchor-link">
109
+
110
+
111
+
112
+
113
+
114
+ </section>
115
+ </main>
116
+
@@ -0,0 +1,207 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ <title>class MyAsk::Api::Helper - Your application title</title>
9
+
10
+ <meta name="keywords" content="ruby,class,MyAsk::Api::Helper">
11
+
12
+ <meta name="description" content="Documentation for the MyAsk::Api::Helper class">
13
+
14
+ <script type="text/javascript">
15
+ var rdoc_rel_prefix = "../../";
16
+ var index_rel_prefix = "../../";
17
+ </script>
18
+
19
+ <script src="../../js/navigation.js" defer></script>
20
+ <script src="../../js/search.js" defer></script>
21
+ <script src="../../js/search_index.js" defer></script>
22
+ <script src="../../js/searcher.js" defer></script>
23
+ <script src="../../js/darkfish.js" defer></script>
24
+
25
+ <link href="../../css/fonts.css" rel="stylesheet">
26
+ <link href="../../css/rdoc.css" rel="stylesheet">
27
+
28
+
29
+ <body id="top" role="document" class="class">
30
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
31
+ <span aria-hidden="true">&#9776;</span>
32
+ </div>
33
+
34
+
35
+ <nav id="navigation" role="navigation">
36
+ <div id="project-navigation">
37
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
38
+ <h2>
39
+ <a href="../../index.html" rel="home">Home</a>
40
+ </h2>
41
+
42
+ <div id="table-of-contents-navigation">
43
+ <a href="../../table_of_contents.html#pages">Pages</a>
44
+ <a href="../../table_of_contents.html#classes">Classes</a>
45
+ <a href="../../table_of_contents.html#methods">Methods</a>
46
+ </div>
47
+ </div>
48
+
49
+ <div id="search-section" role="search" class="project-section initially-hidden">
50
+ <form action="#" method="get" accept-charset="utf-8">
51
+ <div id="search-field-wrapper">
52
+ <input id="search-field" role="combobox" aria-label="Search"
53
+ aria-autocomplete="list" aria-controls="search-results"
54
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
55
+ title="Type to search, Up and Down to navigate, Enter to load">
56
+ </div>
57
+
58
+ <ul id="search-results" aria-label="Search Results"
59
+ aria-busy="false" aria-expanded="false"
60
+ aria-atomic="false" class="initially-hidden"></ul>
61
+ </form>
62
+ </div>
63
+
64
+ </div>
65
+
66
+
67
+
68
+ <div id="parent-class-section" class="nav-section">
69
+ <h3>Ancestors</h3>
70
+ <ul><li>Object</li></ul>
71
+ </div>
72
+
73
+
74
+
75
+
76
+ <div class="nav-section">
77
+ <h3>Class Methods</h3>
78
+ <ul class="link-list" role="directory">
79
+ <li ><a href="#method-c-make_request">make_request</a></li>
80
+ </ul>
81
+ </div>
82
+
83
+
84
+
85
+
86
+
87
+ <footer id="validator-badges" role="contentinfo">
88
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
89
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.13.0.
90
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
91
+ </footer>
92
+
93
+ </nav>
94
+
95
+ <main role="main" aria-labelledby="class-MyAsk::Api::Helper">
96
+
97
+
98
+ <ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
99
+
100
+ <li>
101
+
102
+ <a href="../../MyAsk.html">MyAsk</a><span>::</span>
103
+
104
+ </li>
105
+
106
+ <li>
107
+
108
+ <a href="../../MyAsk/Api.html">Api</a><span>::</span>
109
+
110
+ </li>
111
+
112
+ <li>
113
+
114
+ <span>Helper</span>
115
+
116
+ </li>
117
+
118
+ </ol>
119
+
120
+
121
+ <h1 id="class-MyAsk::Api::Helper" class="anchor-link class">
122
+ class MyAsk::Api::Helper
123
+ </h1>
124
+
125
+ <section class="description">
126
+
127
+ </section>
128
+
129
+ <section id="5Buntitled-5D" class="documentation-section anchor-link">
130
+
131
+
132
+
133
+
134
+
135
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
136
+ <header>
137
+ <h3>Public Class Methods</h3>
138
+ </header>
139
+
140
+ <div id="method-c-make_request" class="method-detail anchor-link ">
141
+ <div class="method-header">
142
+ <div class="method-heading">
143
+ <a href="#method-c-make_request" title="Link to this method">
144
+ <span class="method-name">make_request</span>
145
+ <span class="method-args">(method, uri, api_key, payload = nil)</span>
146
+ </a>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="method-controls">
151
+ <details class="method-source-toggle">
152
+ <summary>Source</summary>
153
+ </details>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <div class="method-source-code" id="make_request-source">
158
+ <pre><span class="ruby-comment"># File lib/myask/api/api_helper.rb, line 5</span>
159
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">make_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">payload</span> = <span class="ruby-keyword">nil</span>)
160
+ <span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>)
161
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;https&#39;</span>
162
+
163
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;Get&quot;</span>
164
+ <span class="ruby-identifier">request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>)
165
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&#39;Authorization&#39;</span>] = <span class="ruby-node">&quot;Bearer #{api_key}&quot;</span>
166
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&quot;Content-Type&quot;</span>] = <span class="ruby-string">&quot;application/json&quot;</span>
167
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
168
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;Delete&quot;</span>
169
+ <span class="ruby-identifier">request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Delete</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>)
170
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&#39;Authorization&#39;</span>] = <span class="ruby-node">&quot;Bearer #{api_key}&quot;</span>
171
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&quot;Content-Type&quot;</span>] = <span class="ruby-string">&quot;application/json&quot;</span>
172
+ <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">to_json</span>
173
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">hostname</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>, <span class="ruby-value">use_ssl:</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;https&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
174
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
175
+ <span class="ruby-keyword">end</span>
176
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;Patch&quot;</span>
177
+ <span class="ruby-identifier">request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Patch</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>)
178
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&#39;Authorization&#39;</span>] = <span class="ruby-node">&quot;Bearer #{api_key}&quot;</span>
179
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&quot;Content-Type&quot;</span>] = <span class="ruby-string">&quot;application/json&quot;</span>
180
+ <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">to_json</span>
181
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">hostname</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>, <span class="ruby-value">use_ssl:</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;https&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
182
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
183
+ <span class="ruby-keyword">end</span>
184
+ <span class="ruby-keyword">else</span>
185
+ <span class="ruby-identifier">request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>)
186
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&#39;Authorization&#39;</span>] = <span class="ruby-node">&quot;Bearer #{api_key}&quot;</span>
187
+ <span class="ruby-identifier">request</span>[<span class="ruby-string">&quot;Content-Type&quot;</span>] = <span class="ruby-string">&quot;application/json&quot;</span>
188
+ <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">to_json</span>
189
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">hostname</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>, <span class="ruby-value">use_ssl:</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;https&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
190
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
191
+ <span class="ruby-keyword">end</span>
192
+ <span class="ruby-keyword">end</span>
193
+
194
+ <span class="ruby-identifier">response</span>
195
+ <span class="ruby-keyword">end</span></pre>
196
+ </div>
197
+
198
+ </div>
199
+
200
+
201
+ </div>
202
+
203
+ </section>
204
+
205
+ </section>
206
+ </main>
207
+
@@ -0,0 +1,212 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ <title>class MyAsk::Api::Invitation - Your application title</title>
9
+
10
+ <meta name="keywords" content="ruby,class,MyAsk::Api::Invitation">
11
+
12
+ <meta name="description" content="Documentation for the MyAsk::Api::Invitation class">
13
+
14
+ <script type="text/javascript">
15
+ var rdoc_rel_prefix = "../../";
16
+ var index_rel_prefix = "../../";
17
+ </script>
18
+
19
+ <script src="../../js/navigation.js" defer></script>
20
+ <script src="../../js/search.js" defer></script>
21
+ <script src="../../js/search_index.js" defer></script>
22
+ <script src="../../js/searcher.js" defer></script>
23
+ <script src="../../js/darkfish.js" defer></script>
24
+
25
+ <link href="../../css/fonts.css" rel="stylesheet">
26
+ <link href="../../css/rdoc.css" rel="stylesheet">
27
+
28
+
29
+ <body id="top" role="document" class="class">
30
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
31
+ <span aria-hidden="true">&#9776;</span>
32
+ </div>
33
+
34
+
35
+ <nav id="navigation" role="navigation">
36
+ <div id="project-navigation">
37
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
38
+ <h2>
39
+ <a href="../../index.html" rel="home">Home</a>
40
+ </h2>
41
+
42
+ <div id="table-of-contents-navigation">
43
+ <a href="../../table_of_contents.html#pages">Pages</a>
44
+ <a href="../../table_of_contents.html#classes">Classes</a>
45
+ <a href="../../table_of_contents.html#methods">Methods</a>
46
+ </div>
47
+ </div>
48
+
49
+ <div id="search-section" role="search" class="project-section initially-hidden">
50
+ <form action="#" method="get" accept-charset="utf-8">
51
+ <div id="search-field-wrapper">
52
+ <input id="search-field" role="combobox" aria-label="Search"
53
+ aria-autocomplete="list" aria-controls="search-results"
54
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
55
+ title="Type to search, Up and Down to navigate, Enter to load">
56
+ </div>
57
+
58
+ <ul id="search-results" aria-label="Search Results"
59
+ aria-busy="false" aria-expanded="false"
60
+ aria-atomic="false" class="initially-hidden"></ul>
61
+ </form>
62
+ </div>
63
+
64
+ </div>
65
+
66
+
67
+
68
+ <div id="parent-class-section" class="nav-section">
69
+ <h3>Ancestors</h3>
70
+ <ul><li>Object</li></ul>
71
+ </div>
72
+
73
+
74
+
75
+
76
+ <div class="nav-section">
77
+ <h3>Class Methods</h3>
78
+ <ul class="link-list" role="directory">
79
+ <li ><a href="#method-c-new">new</a></li>
80
+ </ul>
81
+ </div>
82
+
83
+
84
+
85
+
86
+
87
+ <footer id="validator-badges" role="contentinfo">
88
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
89
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.13.0.
90
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
91
+ </footer>
92
+
93
+ </nav>
94
+
95
+ <main role="main" aria-labelledby="class-MyAsk::Api::Invitation">
96
+
97
+
98
+ <ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
99
+
100
+ <li>
101
+
102
+ <a href="../../MyAsk.html">MyAsk</a><span>::</span>
103
+
104
+ </li>
105
+
106
+ <li>
107
+
108
+ <a href="../../MyAsk/Api.html">Api</a><span>::</span>
109
+
110
+ </li>
111
+
112
+ <li>
113
+
114
+ <span>Invitation</span>
115
+
116
+ </li>
117
+
118
+ </ol>
119
+
120
+
121
+ <h1 id="class-MyAsk::Api::Invitation" class="anchor-link class">
122
+ class MyAsk::Api::Invitation
123
+ </h1>
124
+
125
+ <section class="description">
126
+
127
+ </section>
128
+
129
+ <section id="5Buntitled-5D" class="documentation-section anchor-link">
130
+
131
+
132
+
133
+
134
+
135
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
136
+ <header>
137
+ <h3>Public Class Methods</h3>
138
+ </header>
139
+
140
+ <div id="method-c-new" class="method-detail anchor-link ">
141
+ <div class="method-header">
142
+ <div class="method-heading">
143
+ <a href="#method-c-new" title="Link to this method">
144
+ <span class="method-name">new</span>
145
+ <span class="method-args">(c)</span>
146
+ </a>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="method-controls">
151
+ <details class="method-source-toggle">
152
+ <summary>Source</summary>
153
+ </details>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <div class="method-source-code" id="new-source">
158
+ <pre><span class="ruby-comment"># File lib/myask/api/invitation.rb, line 5</span>
159
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">c</span>)
160
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">desc</span> <span class="ruby-string">&#39;List MyAsk invitations.&#39;</span>
161
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">command</span> <span class="ruby-value">:list</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
162
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">action</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">global_options</span>, <span class="ruby-identifier">_options</span>, <span class="ruby-identifier">_args</span><span class="ruby-operator">|</span>
163
+ <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>(<span class="ruby-node">&quot;#{global_options[:api_host]}/api/invitations&quot;</span>)
164
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">MyAsk</span><span class="ruby-operator">::</span><span class="ruby-constant">Api</span><span class="ruby-operator">::</span><span class="ruby-constant">Helper</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-string">&quot;Get&quot;</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">global_options</span>[<span class="ruby-value">:api_key</span>])
165
+
166
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Invitation sent successfully:&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">global_options</span>[<span class="ruby-value">:json</span>]
167
+ <span class="ruby-identifier">puts</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>))
168
+ <span class="ruby-keyword">end</span>
169
+ <span class="ruby-keyword">end</span>
170
+
171
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">desc</span> <span class="ruby-string">&quot;Send MyAsk invitation to a new user&quot;</span>
172
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">command</span> <span class="ruby-value">:send</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
173
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">desc</span> <span class="ruby-string">&quot;Send MyAsk invitation to a new user&quot;</span>
174
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">flag</span> [<span class="ruby-value">:email</span>], <span class="ruby-value">desc:</span> <span class="ruby-string">&quot;Email of the user to invite to MyAsk&quot;</span>
175
+
176
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">action</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">global_options</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
177
+ <span class="ruby-identifier">email</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:email</span>]
178
+
179
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">email</span>
180
+ <span class="ruby-identifier">prompt</span> = <span class="ruby-constant">TTY</span><span class="ruby-operator">::</span><span class="ruby-constant">Prompt</span>.<span class="ruby-identifier">new</span>
181
+ <span class="ruby-identifier">email</span> = <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">ask</span>(<span class="ruby-string">&#39;Enter invitee email:&#39;</span>)
182
+ <span class="ruby-keyword">end</span>
183
+
184
+ <span class="ruby-identifier">payload</span> = {
185
+ <span class="ruby-value">invitation:</span> {
186
+ <span class="ruby-value">email:</span> <span class="ruby-identifier">email</span>
187
+ }
188
+ }
189
+
190
+ <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>(<span class="ruby-node">&quot;#{global_options[:api_host]}/api/invitations&quot;</span>)
191
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">MyAsk</span><span class="ruby-operator">::</span><span class="ruby-constant">Api</span><span class="ruby-operator">::</span><span class="ruby-constant">Helper</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-string">&quot;Post&quot;</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">global_options</span>[<span class="ruby-value">:api_key</span>], <span class="ruby-identifier">payload</span>)
192
+
193
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Invitation sent successfully:&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">global_options</span>[<span class="ruby-value">:json</span>]
194
+ <span class="ruby-identifier">puts</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>))
195
+ <span class="ruby-keyword">end</span>
196
+ <span class="ruby-keyword">end</span>
197
+
198
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">default_command</span> <span class="ruby-value">:list</span>
199
+ <span class="ruby-identifier">c</span>
200
+ <span class="ruby-keyword">end</span></pre>
201
+ </div>
202
+
203
+ </div>
204
+
205
+
206
+ </div>
207
+
208
+ </section>
209
+
210
+ </section>
211
+ </main>
212
+