rentlinx 0.7.5 → 0.8.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: ece9f2f15c9e92ce559ec368a07a2831d1e49e8c
4
- data.tar.gz: 0544f5c26e482eff2f9e72dfa08785e71f1ab2d6
3
+ metadata.gz: 52a68d631c3459cebfc7d4d57bb434e60a6410a2
4
+ data.tar.gz: 52fd5b94f040ad0d208eab6697711eb43cb5d90a
5
5
  SHA512:
6
- metadata.gz: 7e865bd65d1c31d11a9feec2635bc4269e03ecc3c0c6cbb4b3fc37cb7c618beef13053e2e6f561de9afbae967539a7661e5d1769a420ada3a0eeafa73f66a695
7
- data.tar.gz: a0efc6f995b6e1d7ad073da35a24d5ec26657938377bc20fb042551fac8766e339582d3e5c9f2fddeb6386bf4beaee8c4afa7e0b2fb91b115472586b70921b6d
6
+ metadata.gz: cd38b0e79d27b748cfa532230807e15222ecaac3b8c1d5d7583c57c9bf17d98619d8f212f39581d3df1be8c5557cec6cc0ec923637a1d677ffbf24f075fbf45a
7
+ data.tar.gz: 779d59493594b95dc865c4aecc205d2976d61c668fe34c302ba10667568f2cda9131975053e714ec345918ee5a4ba2be63c65aa489a83ef66b034b2ca10c4a75
@@ -8,7 +8,7 @@ module Rentlinx
8
8
  :zip, :marketingName, :hideAddress, :latitude, :longitude,
9
9
  :website, :yearBuilt, :numUnits, :phoneNumber, :extension,
10
10
  :faxNumber, :emailAddress, :acceptsHcv, :propertyType,
11
- :activeURL, :companyName]
11
+ :activeURL, :companyName, :leadsURL]
12
12
 
13
13
  REQUIRED_ATTRIBUTES = [:propertyID, :address, :city, :state, :zip,
14
14
  :phoneNumber, :emailAddress]
@@ -2,6 +2,7 @@ require 'rentlinx/validators/base_validator'
2
2
  require 'rentlinx/validators/phone_validator'
3
3
  require 'rentlinx/validators/state_validator'
4
4
  require 'rentlinx/validators/zip_validator'
5
+ require 'rentlinx/validators/url_validator'
5
6
 
6
7
  module Rentlinx
7
8
  class AttributeProcessor
@@ -17,7 +18,8 @@ module Rentlinx
17
18
  def process
18
19
  validators = { phoneNumber: PhoneValidator,
19
20
  state: StateValidator,
20
- zip: ZipValidator }
21
+ zip: ZipValidator,
22
+ leadsURL: UrlValidator }
21
23
 
22
24
  @attrs.each do |field, val|
23
25
  next unless validators.keys.include?(field)
@@ -0,0 +1,17 @@
1
+ module Rentlinx
2
+ class UrlValidator < BaseValidator
3
+ private
4
+
5
+ def validate
6
+ return if value_blank? || valid_url?(@value)
7
+ @error = "#{@value} is not a valid URL"
8
+ end
9
+
10
+ def valid_url?(url)
11
+ uri = URI.parse(url)
12
+ uri.is_a?(URI::HTTP)
13
+ rescue URI::InvalidURIError
14
+ false
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Rentlinx
2
- VERSION = '0.7.5'
2
+ VERSION = '0.8.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.7.5
4
+ version: 0.8.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-08-11 00:00:00.000000000 Z
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -85,6 +85,7 @@ files:
85
85
  - lib/rentlinx/validators/base_validator.rb
86
86
  - lib/rentlinx/validators/phone_validator.rb
87
87
  - lib/rentlinx/validators/state_validator.rb
88
+ - lib/rentlinx/validators/url_validator.rb
88
89
  - lib/rentlinx/validators/zip_validator.rb
89
90
  - lib/rentlinx/version.rb
90
91
  homepage: https://github.com/appfolio/rentlinx_client