rentlinx 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rentlinx.rb +34 -3
- data/lib/rentlinx/client.rb +3 -8
- data/lib/rentlinx/default.rb +0 -1
- data/lib/rentlinx/version.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e982c2be41722f9f4d073747e2e1b62c65a7e6c
|
4
|
+
data.tar.gz: 7f402610e2f22b453b6824d8049898be05db4325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9456965acfd7fa9d0f36201fd836db98803029fbbf10e81a44fc3d68908ef712922d4426c31920c457b182d83b483fea964a1fd982b496acf02de5919e037e5
|
7
|
+
data.tar.gz: 75d49028469c3b1948f9659701a25a1cfaefe66de95731a74b7f7c87fe2181b5f102b55706899b5af8ea9e21a94ff77e158fdeaa925137e7d1d928d62fdcfb8b
|
data/lib/rentlinx.rb
CHANGED
@@ -1,10 +1,41 @@
|
|
1
1
|
require 'rentlinx/client'
|
2
2
|
|
3
|
-
# The Rentlinx module provides the means to interact with the Rentlinx API.
|
4
3
|
module Rentlinx
|
4
|
+
@username = nil
|
5
|
+
@password = nil
|
6
|
+
@api_url_prefix = nil
|
7
|
+
|
5
8
|
class << self
|
6
|
-
def
|
7
|
-
|
9
|
+
def configure(&block)
|
10
|
+
block.call(self)
|
11
|
+
end
|
12
|
+
|
13
|
+
def username(*args)
|
14
|
+
if args.empty?
|
15
|
+
@username
|
16
|
+
else
|
17
|
+
@username = args.first
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def password(*args)
|
22
|
+
if args.empty?
|
23
|
+
@password
|
24
|
+
else
|
25
|
+
@password = args.first
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def api_url_prefix(*args)
|
30
|
+
if args.empty?
|
31
|
+
@api_url_prefix
|
32
|
+
else
|
33
|
+
@api_url_prefix = args.first
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def client
|
38
|
+
@client ||= Rentlinx::Client.new
|
8
39
|
end
|
9
40
|
end
|
10
41
|
end
|
data/lib/rentlinx/client.rb
CHANGED
@@ -4,15 +4,10 @@ require 'uri'
|
|
4
4
|
require 'rentlinx/default'
|
5
5
|
|
6
6
|
module Rentlinx
|
7
|
-
# Client is the primary interface that users of this gem will utilize.
|
8
7
|
class Client
|
9
|
-
def initialize
|
10
|
-
@url_prefix = (api_url_prefix + '/').freeze # Extra slashes are fine
|
11
|
-
@api_token ||= authenticate(username, password)
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.health_check(username, password, api_url_prefix)
|
15
|
-
new(username, password, api_url_prefix)
|
8
|
+
def initialize
|
9
|
+
@url_prefix = (Rentlinx.api_url_prefix + '/').freeze # Extra slashes are fine
|
10
|
+
@api_token ||= authenticate(Rentlinx.username, Rentlinx.password)
|
16
11
|
end
|
17
12
|
|
18
13
|
private
|
data/lib/rentlinx/default.rb
CHANGED
data/lib/rentlinx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rentlinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|