simply_reddit 0.1.2 → 0.1.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
  SHA256:
3
- metadata.gz: e2c47a3eb7e7e510061f81c05bd7d89ff41d6bc537c862d613ee8d17a23e1e44
4
- data.tar.gz: f58fdb9e8f300cc94d22ce81697c6857e600bea0e30a7bd459f8e9aadf607197
3
+ metadata.gz: 7b190572f13f32f358a3170d73f3bbd407b086c1fc07fdb70a420120445bf290
4
+ data.tar.gz: 26cdcac41d91a02dc8d9fb9dc40d1d1793864c0d8dbaf87bf526725086a3e7bd
5
5
  SHA512:
6
- metadata.gz: 17143add4b23d73e7f51462ad6d018820cdfd2086b2c438f4f75dbe67b16857bdcf85b6b2c9691895232abcc460b25c0dce09c6aa94a2b50ca81b30cbda7a52d
7
- data.tar.gz: 869cf82cef3132470c4ed03260c9af6a59e8190c487cb33edc400678b759204144fa0eb6461d82e938f4073c6804173bbf2b0c3a2b5db7feb44c3d288b35cdef
6
+ metadata.gz: d677d6c7f8aa9d8182c23bdbc8ffdff479b8f920f91215bca24de71feac824d203ba57e643a2753d264795fdc9277260f4ee90eb8500ca1c1368495051abcd06
7
+ data.tar.gz: 953de1f9852f38829a7bd2cb312dd1b728778e0792f176c8af8320d2b45fcb9a74979ef9f0424dbc5809f4687249e626b598b31275093f608b1e57b5ce25a396
data/README.md CHANGED
@@ -24,14 +24,71 @@ gem install simply_reddit
24
24
 
25
25
  ## Usage
26
26
 
27
+ ### Authentication
28
+
27
29
  ```ruby
28
30
  require 'simply_reddit'
29
31
 
30
- client = SimplyReddit.client(
32
+ client = SimplyReddit::Client.new(
31
33
  client_id: 'your_client_id',
32
34
  secret: 'your_client_secret',
33
35
  username: 'your_username',
34
36
  password: 'your_password'
35
37
  )
36
38
  ```
39
+
40
+ ### Getting Current User Information
41
+
42
+ ```ruby
43
+ # Get information about the authenticated user
44
+ response = client.me
45
+ puts response.body # User data as JSON
46
+ puts response.status # HTTP status code
47
+ ```
48
+
49
+ ### Working with Subreddits
50
+
51
+ ```ruby
52
+ # Access a specific subreddit
53
+ subreddit = client.subreddit('ruby')
54
+
55
+ # The subreddit object provides access to subreddit-specific functionality
56
+ # (specific methods depend on your Subreddit class implementation)
57
+ ```
58
+
59
+ ### Working with Users
60
+
61
+ ```ruby
62
+ # Access a specific user's profile
63
+ user = client.user('spez')
64
+
65
+ # The user object provides access to user-specific functionality
66
+ # (specific methods depend on your User class implementation)
67
+ ```
68
+
69
+ ### Response Format
70
+
71
+ All API responses are wrapped in a `Response` object with the following structure:
72
+
73
+ ```ruby
74
+ response.status # HTTP status code (200, 404, etc.)
75
+ response.headers # HTTP headers as a hash
76
+ response.body # Parsed JSON response body
77
+ ```
78
+
79
+ ### Error Handling
80
+
81
+ ```ruby
82
+ response = client.me
83
+
84
+ case response.status
85
+ when 200
86
+ puts "Success: #{response.body}"
87
+ when 401
88
+ puts "Authentication failed"
89
+ when 403
90
+ puts "Forbidden - check your credentials"
91
+ else
92
+ puts "Error: #{response.status}"
93
+ end
37
94
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimplyReddit
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simply_reddit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Lu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-24 00:00:00.000000000 Z
11
+ date: 2025-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday