Class: Medium::Client
- Inherits:
-
Object
- Object
- Medium::Client
- Defined in:
- lib/medium/client.rb
Overview
The Client class is used to interact with the resources the Medium API exposes.
Instance Attribute Summary collapse
-
#posts ⇒ Medium::Users
readonly
Create a posts resource sub-client if necessary.
-
#users ⇒ Medium::Users
readonly
Create a user resource sub-client if necessary.
Instance Method Summary collapse
-
#initialize(auth_creds) ⇒ Client
constructor
Creates a new instance of Medium::Client.
Constructor Details
#initialize(auth_creds) ⇒ Client
Creates a new instance of Medium::Client.
15 16 17 18 19 20 21 |
# File 'lib/medium/client.rb', line 15 def initialize(auth_creds) @client = Hurley::Client.new 'https://api.medium.com/v1/' @client.connection = Hurley::HttpCache.new auth_headers_with auth_creds true end |
Instance Attribute Details
#posts ⇒ Medium::Users (readonly)
Create a posts resource sub-client if necessary.
8 9 10 |
# File 'lib/medium/client.rb', line 8 def posts @posts end |
#users ⇒ Medium::Users (readonly)
Create a user resource sub-client if necessary.
8 9 10 |
# File 'lib/medium/client.rb', line 8 def users @users end |