rentlinx 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd7e71d9b420e619244ea04b0e3eef8b6b272327
4
- data.tar.gz: d05cba513432d668bb8a413f4e5c79f281a5dffb
3
+ metadata.gz: 31bef4a7065d37c23ad99d11afa8dec3688cba92
4
+ data.tar.gz: 938ea3a628d74e1d243b1d0fabed247f343ad2ed
5
5
  SHA512:
6
- metadata.gz: 2ffa60670881d167ce8c2f2b7886101000f592b376c1b9b5b301cb14bbf97bc53ba53951835b072b7348a0333795d33d11aa7e5711a6f7b5300397d917ab647e
7
- data.tar.gz: 04c78c36611065c179a71b8117681c35ced540b76292f9d273da7fbb01cea9c6a794ef475b78a7ef4bcefd27d54e1bd3a6912d75adc77d965aa98bb9f4efdd1e
6
+ metadata.gz: d297e9d45f2a5099f47ad052b9c93f2caf5a51ae8a634c4991b549fe9d7644e8fc6131e0e9eccf91e85366d11ba9c4eb12b70274e870fe5745d461f207bf9a08
7
+ data.tar.gz: 2edcbe21509b811a4f55ca9a033d1f9d9feb5088e993e62d8bb605e27bb1f44620d9c3c5ab485d7da3deb42c7349022ea30ed4bd3f7c987846599567c6c90ed6
@@ -8,7 +8,7 @@ require 'rentlinx/models/unit'
8
8
  module Rentlinx
9
9
  @username = nil
10
10
  @password = nil
11
- @api_url_prefix = nil
11
+ @site_url = nil
12
12
 
13
13
  class << self
14
14
  def configure(&block)
@@ -31,11 +31,11 @@ module Rentlinx
31
31
  end
32
32
  end
33
33
 
34
- def api_url_prefix(*args)
34
+ def site_url(*args)
35
35
  if args.empty?
36
- @api_url_prefix
36
+ @site_url
37
37
  else
38
- @api_url_prefix = args.first
38
+ @site_url = args.first
39
39
  end
40
40
  end
41
41
 
@@ -8,9 +8,9 @@ module Rentlinx
8
8
  def initialize
9
9
  raise Rentlinx::NotConfigured if Rentlinx.username.nil? ||
10
10
  Rentlinx.password.nil? ||
11
- Rentlinx.api_url_prefix.nil?
11
+ Rentlinx.site_url.nil?
12
12
 
13
- @url_prefix = (Rentlinx.api_url_prefix + '/').freeze # Extra slashes are fine
13
+ @url_prefix = (Rentlinx.site_url + '/').freeze # Extra slashes are fine
14
14
  @api_token ||= authenticate(Rentlinx.username, Rentlinx.password)
15
15
  end
16
16
 
@@ -1,9 +1,13 @@
1
1
  module Rentlinx
2
2
  class StateValidator < BaseValidator
3
+ STATES = %w(AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI
4
+ MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX
5
+ UT VT VA WA WV WI WY AS DC GU MP PR VI)
6
+
3
7
  private
4
8
 
5
9
  def validate
6
- return if @value.nil? || @value == '' || @value.size == 2
10
+ return if @value.nil? || @value == '' || (@value.size == 2 && STATES.include?(@value.upcase))
7
11
  @error = "#{@value} is not a valid state, states must be two characters (CA)"
8
12
  end
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module Rentlinx
2
- VERSION = '0.4.4'
2
+ VERSION = '0.5.0'
3
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.4.4
4
+ version: 0.5.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-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient