ahub 0.1.14 → 0.1.15
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 +4 -4
- data/lib/ahub/answer.rb +1 -3
- data/lib/ahub/modules/api_helpers.rb +1 -1
- data/lib/ahub/question.rb +5 -4
- data/lib/ahub/user.rb +1 -1
- data/lib/ahub/version.rb +1 -1
- data/lib/ahub.rb +0 -1
- metadata +1 -2
- data/lib/ahub/exception_factory.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 449165080aa0a7a49f1863a0adb6175e3b40f83e
|
4
|
+
data.tar.gz: a64ec6193b9e7a5fd9cfce8604aa08c70a78faa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c7cf47b4fb9019bae3c3a8f70608e7669e5132db1a07bcfbd28926b583efde34efed27e8c211c4b9a4ea4f089928aeda45e2ca01bb310563b99748a6a9b13db
|
7
|
+
data.tar.gz: 984e3c9ec063cc4d5c685dceb93bfe433a207fe8b890e1a1ab2e84353b2b513cffe822c910e28e99977499a1a05ac4b89481b73fa346cf124d92e630f1611aad
|
data/lib/ahub/answer.rb
CHANGED
@@ -4,11 +4,9 @@ module Ahub
|
|
4
4
|
include Ahub::ClassHelpers
|
5
5
|
|
6
6
|
def self.create(question_id:, body:, username:, password:)
|
7
|
-
payload = {body: body}
|
8
|
-
|
9
7
|
url = "#{Ahub::DOMAIN}/services/v2/question/#{question_id}/answer.json"
|
10
8
|
|
11
|
-
make_post_call(url,
|
9
|
+
make_post_call(url, {body: body}, headers(username: username, password: password))
|
12
10
|
end
|
13
11
|
|
14
12
|
attr_reader :body, :body_as_html, :author
|
data/lib/ahub/question.rb
CHANGED
@@ -3,19 +3,20 @@ module Ahub
|
|
3
3
|
extend Ahub::APIHelpers
|
4
4
|
include Ahub::ClassHelpers
|
5
5
|
|
6
|
-
attr_accessor :title, :body, :body_as_html, :author
|
7
|
-
attr_reader :space_id, :answerCount
|
8
|
-
|
9
6
|
def self.create(title:, body:, topics:, space_id: nil, username:, password:)
|
10
7
|
url = "#{base_url}.json"
|
8
|
+
|
11
9
|
payload = {title: title, body: body, topics: topics}
|
12
10
|
payload[:spaceId] = space_id if space_id
|
13
11
|
|
14
12
|
user_headers = headers(username:username, password:password)
|
15
13
|
|
16
|
-
make_post_call(url: url, payload: payload
|
14
|
+
make_post_call(url: url, payload: payload, headers: user_headers)
|
17
15
|
end
|
18
16
|
|
17
|
+
attr_accessor :title, :body, :body_as_html, :author
|
18
|
+
attr_reader :space_id, :answerCount
|
19
|
+
|
19
20
|
def initialize(attrs)
|
20
21
|
@answer_ids = attrs[:answers]
|
21
22
|
@answerCount = attrs[:answerCount]
|
data/lib/ahub/user.rb
CHANGED
data/lib/ahub/version.rb
CHANGED
data/lib/ahub.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abel Martin
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- bin/setup
|
119
119
|
- lib/ahub.rb
|
120
120
|
- lib/ahub/answer.rb
|
121
|
-
- lib/ahub/exception_factory.rb
|
122
121
|
- lib/ahub/group.rb
|
123
122
|
- lib/ahub/modules/api_helpers.rb
|
124
123
|
- lib/ahub/modules/class_helpers.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Ahub
|
2
|
-
class ExceptionFactory
|
3
|
-
attr_reader :orignal_exception
|
4
|
-
def initialize(exception)
|
5
|
-
new UnknownError(exception)
|
6
|
-
|
7
|
-
@orignal_exception = exception
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class RequestError < Exception ; end
|
12
|
-
class RedirectError < Exception ; end
|
13
|
-
class LicenseError < Exception ; end
|
14
|
-
class UnknownError < Exception ; end
|
15
|
-
end
|