onepost 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 9b5ffd7446734ce24cf0c973f0f6c7d969f021fd5277a77ccb68a8bd93eb8bd4
4
- data.tar.gz: e0c461a70c672f63ff4cfbc6916431fc8da622095400604761410fa0a1531005
3
+ metadata.gz: 2b149577bc4d28f5f06aa97dd1430d79d392c5a1a6e77c74e864194dc119280b
4
+ data.tar.gz: ae78ddf716d616228a72b5fface990f9d966df17ec607f5326a971b5622ffe74
5
5
  SHA512:
6
- metadata.gz: 30d1d19c54a62cfc365abecb59a5af501d0577aadc5c07a328ea4bf533c24cd6a131fa9a1da6b5b4a86e21e69503d3479768ee882056de73348e1778f854577a
7
- data.tar.gz: a48bae9fdb5d9f85c6aec50c14022f0f7007f6288eb294c35b4a0f87711083ac60c4d333ba411981567b6e9489a4062fbdb22044e14e7fc7c75dca9353c95345
6
+ metadata.gz: 4db4649e1992b3ccfc154c37616a115673e0046b2e391b242cd3a361b90a13eb191082d51ddedc47eaba24ffe0006779b93d4f1d14f55f7fd5c83bfefbeab104
7
+ data.tar.gz: abb1cceb7228c4090b1dbca813bf67f6f40777c7ca76bf64945a4cad88b559f88bef200af6ed31cc77f67046573c83eac2e0d475c7a0c0e870d236d3377f769d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- onepost (0.1.0)
4
+ onepost (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/onepost.rb CHANGED
@@ -7,6 +7,7 @@ require 'onepost/provider'
7
7
  require 'onepost/authorization'
8
8
  require 'onepost/authorized_page'
9
9
  require 'onepost/post'
10
+ require 'onepost/post_intent'
10
11
  require 'onepost/social_post'
11
12
  require 'onepost/webhook'
12
13
  require 'onepost/event'
@@ -4,6 +4,7 @@ module Onepost
4
4
  include Onepost::Authorization
5
5
  include Onepost::AuthorizedPage
6
6
  include Onepost::Post
7
+ include Onepost::PostIntent
7
8
  include Onepost::SocialPost
8
9
  include Onepost::Webhook
9
10
  include Onepost::Event
@@ -0,0 +1,23 @@
1
+ module Onepost
2
+ module PostIntent
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ def get_post_intent(id, options={})
7
+ url = construct_url("api/v1/post_intents/#{id}")
8
+ query = default_query.merge(options.fetch(:query, {}))
9
+ body = default_body.merge(options.fetch(:body, {}))
10
+ headers = default_headers.merge(options.fetch(:headers, {}))
11
+
12
+ response = HTTParty.get(url, {
13
+ query: query,
14
+ body: body.to_json,
15
+ headers: headers,
16
+ timeout: Onepost::Client::TIMEOUT
17
+ })
18
+
19
+ JSON.parse(response.body)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Onepost
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onepost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Darrah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -89,6 +89,7 @@ files:
89
89
  - lib/onepost/client.rb
90
90
  - lib/onepost/event.rb
91
91
  - lib/onepost/post.rb
92
+ - lib/onepost/post_intent.rb
92
93
  - lib/onepost/provider.rb
93
94
  - lib/onepost/social_post.rb
94
95
  - lib/onepost/version.rb