bskyrb 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ae64c99f896f5ec3366f9c4e028d61c9006563351c34be989881ccb4fac52d9
4
- data.tar.gz: 57903df97da314a87e257fad02d8536ad783ea88511c2f5b7efbf774ad36b4b4
3
+ metadata.gz: acb1d587977217b5e0e2e373c422fe69702364524c29d96ddf6b3cf5c537eed5
4
+ data.tar.gz: 7094841141b05f7b24024c6ebd5df494486f125202ce2ceb79e06ef29b9512dc
5
5
  SHA512:
6
- metadata.gz: 447074d457ecb73774ce6e355f3cd18820b13e508c58f144361105b8bb1bf6fe7547ac994d62c5a2fbdec49b3d56b96fd8fdcadfeb6d967cc521e983c7a84f26
7
- data.tar.gz: f3440ccc3800260c21481da110ea68aa40e4d48ca70ab1e6292d80435820f389f0f59f3f02c31029812d2d9335d42cbddcefc3f40c1e667d0a21e139642e5d7c
6
+ metadata.gz: 012464fcc4bf3c84ada9a11b0f9bc7b13d7bcbff3378cc9724822474daa11eeb37b718589498f15885b9efc4694b0e46b8884d00af3e2a7126dcead4ff3d2fd0
7
+ data.tar.gz: 26cea956181b0d593a7e164de63b8d48293c94308d2bba3c53461add0d5254f229bb9072198fa661f4f6c2df526ab9429bf7804b3c1672512f11419a1ccea279
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Bskyrb
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
  end
@@ -0,0 +1,24 @@
1
+ # typed: false
2
+ require "uri"
3
+ require "httparty"
4
+ require "json"
5
+
6
+ module XRPC
7
+ class Endpoint
8
+ attr_reader :request_uri
9
+
10
+ def initialize(pds, endpoint_location, *params)
11
+ @pds = pds
12
+ @endpoint_location = endpoint_location
13
+ @params = params
14
+ end
15
+
16
+ def get(params)
17
+ query_params = URI.encode_www_form(params)
18
+ @request_uri = URI("#{@pds}/xrpc/#{@endpoint_location}?#{query_params}")
19
+
20
+ response = HTTParty.get(@request_uri)
21
+ JSON.parse(response.body)
22
+ end
23
+ end
24
+ end
data/lib/bskyrb.rb CHANGED
@@ -5,4 +5,4 @@ require "bskyrb/error"
5
5
  require "bskyrb/session"
6
6
  require "bskyrb/records"
7
7
  require "bskyrb/generated_classes"
8
- require "xrpc"
8
+ require "bskyrb/xrpc"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bskyrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shreyan Jain
@@ -68,6 +68,7 @@ files:
68
68
  - "./lib/bskyrb/records.rb"
69
69
  - "./lib/bskyrb/session.rb"
70
70
  - "./lib/bskyrb/version.rb"
71
+ - "./lib/bskyrb/xrpc.rb"
71
72
  homepage: https://github.com/ShreyanJain9/bskyrb
72
73
  licenses:
73
74
  - MIT