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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62760941602e190d7e71c0a22c7b7c471d3c4e47
4
- data.tar.gz: 835279ed9de32624308d7b25363edbb57cdbdaf4
3
+ metadata.gz: 5e982c2be41722f9f4d073747e2e1b62c65a7e6c
4
+ data.tar.gz: 7f402610e2f22b453b6824d8049898be05db4325
5
5
  SHA512:
6
- metadata.gz: ef753885a804dd79fcbe08be8e8c71b10b2fef8e10cf2d4852551862fd437ec137c9c0bfb930bf4de804f6cf449af158b3614529f2984076ddaac357c803f2eb
7
- data.tar.gz: fa4d97045432cca302923b2c4c739b486e5dff802c6fb965d27645315c2116a9f92c2ae2e0b092904894985871114e7f6bab1a8a9172f22c25e50387d17f1dc5
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 client(*args)
7
- @client ||= Rentlinx::Client.new(*args)
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
@@ -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(username, password, api_url_prefix)
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
@@ -1,7 +1,6 @@
1
1
  require 'rentlinx/version'
2
2
 
3
3
  module Rentlinx
4
- # The Default module provides the default configuration options.
5
4
  module Default
6
5
  USER_AGENT = "Rentlinx Ruby Client #{Rentlinx::VERSION}".freeze
7
6
 
@@ -1,4 +1,3 @@
1
- # Rentlinx
2
1
  module Rentlinx
3
- VERSION = '0.0.3'
2
+ VERSION = '0.1.0'
4
3
  end
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.3
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-15 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient