mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-04-27 14:57:44 +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/bookmark'
|
||||||
require 'instapaper/api/folder'
|
require 'instapaper/api/folder'
|
||||||
require 'instapaper/api/highlight'
|
require 'instapaper/api/highlight'
|
||||||
require 'instapaper/api/user'
|
require 'instapaper/api/oauth'
|
||||||
|
|
||||||
module Instapaper
|
module Instapaper
|
||||||
module API
|
module API
|
||||||
|
|
@ -10,6 +10,6 @@ module Instapaper
|
||||||
include Instapaper::API::Bookmark
|
include Instapaper::API::Bookmark
|
||||||
include Instapaper::API::Folder
|
include Instapaper::API::Folder
|
||||||
include Instapaper::API::Highlight
|
include Instapaper::API::Highlight
|
||||||
include Instapaper::API::User
|
include Instapaper::API::OAuth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
module Instapaper
|
module Instapaper
|
||||||
module API
|
module API
|
||||||
# Defines methods related to users
|
# Defines methods related to OAuth
|
||||||
module User
|
module OAuth
|
||||||
# Gets an OAuth access token for a user.
|
# Gets an OAuth access token for a user.
|
||||||
def access_token(username, password)
|
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)
|
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 :user_agent
|
||||||
attr_accessor :connection_options
|
attr_accessor :connection_options
|
||||||
|
|
||||||
|
# Creates a new Instapaper::Client
|
||||||
# Creates a new API
|
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
reset
|
reset
|
||||||
options.keys.each do |key|
|
options.keys.each do |key|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Instapaper::Client::User do
|
describe Instapaper::Client::OAuth do
|
||||||
let(:client) { Instapaper::Client.new }
|
let(:client) { Instapaper::Client.new }
|
||||||
|
|
||||||
describe '.access_token' do
|
describe '.access_token' do
|
||||||
Loading…
Reference in a new issue