rentlinx 0.7.5 → 0.8.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52a68d631c3459cebfc7d4d57bb434e60a6410a2
|
4
|
+
data.tar.gz: 52fd5b94f040ad0d208eab6697711eb43cb5d90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
+
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
|