mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-03-25 08:55:49 +00:00
rename User module to OAuth to match API methods
This commit is contained in:
parent
d66ab48a23
commit
9427881029
4 changed files with 6 additions and 7 deletions
|
|
@ -2,7 +2,7 @@ require 'instapaper/api/account'
|
|||
require 'instapaper/api/bookmark'
|
||||
require 'instapaper/api/folder'
|
||||
require 'instapaper/api/highlight'
|
||||
require 'instapaper/api/user'
|
||||
require 'instapaper/api/oauth'
|
||||
|
||||
module Instapaper
|
||||
module API
|
||||
|
|
@ -10,6 +10,6 @@ module Instapaper
|
|||
include Instapaper::API::Bookmark
|
||||
include Instapaper::API::Folder
|
||||
include Instapaper::API::Highlight
|
||||
include Instapaper::API::User
|
||||
include Instapaper::API::OAuth
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
module Instapaper
|
||||
module API
|
||||
# Defines methods related to users
|
||||
module User
|
||||
# Defines methods related to OAuth
|
||||
module OAuth
|
||||
# Gets an OAuth access token for a user.
|
||||
def access_token(username, password)
|
||||
response = post('/api/1/oauth/access_token', {x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth'}, true)
|
||||
|
|
@ -60,8 +60,7 @@ module Instapaper
|
|||
attr_accessor :user_agent
|
||||
attr_accessor :connection_options
|
||||
|
||||
|
||||
# Creates a new API
|
||||
# Creates a new Instapaper::Client
|
||||
def initialize(options = {})
|
||||
reset
|
||||
options.keys.each do |key|
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Instapaper::Client::User do
|
||||
describe Instapaper::Client::OAuth do
|
||||
let(:client) { Instapaper::Client.new }
|
||||
|
||||
describe '.access_token' do
|
||||
Loading…
Reference in a new issue