estated 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 899b4683901b47eb81f05952ee6f9d6b8c299ece661dbd1dc3a3c85d867b080b
4
+ data.tar.gz: fe4f49ea7a9ae5ffaab689f091b4378e61346826f5298d5f35c7cdd41c3b1a3c
5
+ SHA512:
6
+ metadata.gz: 54b43b2899aba31078b752d7d09e01c3474b6ba43cb248b3f9f953dd973dca214e814e9238c6a7b60492bb2a9775c912cb3f74da37948a2c600e9c8822edf992
7
+ data.tar.gz: 4215a4464db1e9f1b7c0635120673bf21269830c89c2c4b330d867d961cbc3714d9fa31e8638b5102488a9f24a85848ae96b288eb61235c1a37ded74002561ec
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # Byebug
11
+ .byebug_history
12
+
13
+ # rspec failure tracking
14
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.5
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in estated.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,58 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ estated (0.1.0)
5
+ httparty
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ byebug (11.0.1)
13
+ crack (0.4.3)
14
+ safe_yaml (~> 1.0.0)
15
+ diff-lcs (1.3)
16
+ hashdiff (0.4.0)
17
+ httparty (0.17.0)
18
+ mime-types (~> 3.0)
19
+ multi_xml (>= 0.5.2)
20
+ mime-types (3.2.2)
21
+ mime-types-data (~> 3.2015)
22
+ mime-types-data (3.2019.0331)
23
+ multi_xml (0.6.0)
24
+ public_suffix (4.0.1)
25
+ rake (12.3.3)
26
+ rspec (3.9.0)
27
+ rspec-core (~> 3.9.0)
28
+ rspec-expectations (~> 3.9.0)
29
+ rspec-mocks (~> 3.9.0)
30
+ rspec-core (3.9.1)
31
+ rspec-support (~> 3.9.1)
32
+ rspec-expectations (3.9.0)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.9.0)
35
+ rspec-mocks (3.9.1)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.9.0)
38
+ rspec-support (3.9.2)
39
+ safe_yaml (1.0.5)
40
+ vcr (5.1.0)
41
+ webmock (3.6.0)
42
+ addressable (>= 2.3.6)
43
+ crack (>= 0.3.2)
44
+ hashdiff (>= 0.4.0, < 2.0.0)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ byebug
51
+ estated!
52
+ rake (~> 12.0)
53
+ rspec (~> 3.0)
54
+ vcr
55
+ webmock
56
+
57
+ BUNDLED WITH
58
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Débora Setton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Estated
2
+
3
+ `estated` is a Ruby client for the Estated API: https://estated.com/developers/docs/v4
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'estated'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install estated
20
+
21
+ ## Usage
22
+
23
+ ### Configuration
24
+
25
+ ```ruby
26
+ Estated.configure do |config|
27
+ config.api_key = 'YOUR_API_KEY'
28
+ end
29
+ ```
30
+
31
+ The API key can also be set through the `ESTATED_API_KEY` environment variable.
32
+
33
+ In case the API key is set in the environment variable _and_ in the configuration block, the configuration will take precedence.
34
+
35
+ ### Usage
36
+
37
+ For documentation on parameters, please check the [Estated API docs](https://estated.com/developers/docs/v4/property/overview) on how to retrieve properties.
38
+
39
+ ```ruby
40
+ # Combined address
41
+ Estated::API.get_property(combined_address: '151 Battle Green Dr, Rochester, NY 14624')
42
+
43
+ # FIPS code + APN
44
+ Estated::API.get_property(fips: '04013', apn: '217-53-698')
45
+ ```
46
+
47
+ ## Development
48
+
49
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
50
+
51
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/navut/estated-ruby-client.
56
+
57
+
58
+ ## License
59
+
60
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "estated"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/estated.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ require_relative 'lib/estated/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "estated"
5
+ spec.version = Estated::VERSION
6
+ spec.authors = ["Alex VKO", "Débora Setton", "Felipe Pedroni Favoreto"]
7
+ spec.email = ["engineering@nestready.ai"]
8
+
9
+ spec.summary = %q{Ruby client for Estated API: https://estated.com/developers/docs/v4}
10
+ spec.homepage = "https://github.com/navut/estated-ruby-client"
11
+ spec.license = "MIT"
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = "https://github.com/navut/estated-ruby-client"
16
+
17
+ # TODO: have a CHANGELOG.md
18
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_dependency "httparty"
30
+
31
+ spec.add_development_dependency "byebug"
32
+ spec.add_development_dependency "vcr"
33
+ spec.add_development_dependency "webmock"
34
+ end
@@ -0,0 +1,14 @@
1
+ require 'httparty'
2
+
3
+ module Estated
4
+ class API
5
+ include HTTParty
6
+
7
+ base_uri 'https://apis.estated.com/v4'
8
+
9
+ def self.get_property(params)
10
+ query = params.merge(token: Estated.config.api_key)
11
+ self.get('/property', query: query).parsed_response
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ module Estated
2
+ class Config
3
+ attr_writer :api_key
4
+
5
+ def api_key
6
+ @api_key ||= ENV['ESTATED_API_KEY']
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Estated
2
+ VERSION = "0.1.0"
3
+ end
data/lib/estated.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'estated/api'
2
+ require 'estated/config'
3
+ require 'estated/version'
4
+
5
+ module Estated
6
+ def self.config
7
+ @config ||= Config.new
8
+ end
9
+
10
+ def self.config=(config)
11
+ @config = config
12
+ end
13
+
14
+ def self.configure
15
+ yield(config)
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: estated
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Alex VKO
8
+ - Débora Setton
9
+ - Felipe Pedroni Favoreto
10
+ autorequire:
11
+ bindir: exe
12
+ cert_chain: []
13
+ date: 2020-03-04 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: httparty
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: byebug
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: vcr
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: webmock
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ description:
72
+ email:
73
+ - engineering@nestready.ai
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".travis.yml"
81
+ - Gemfile
82
+ - Gemfile.lock
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - bin/console
87
+ - bin/setup
88
+ - estated.gemspec
89
+ - lib/estated.rb
90
+ - lib/estated/api.rb
91
+ - lib/estated/config.rb
92
+ - lib/estated/version.rb
93
+ homepage: https://github.com/navut/estated-ruby-client
94
+ licenses:
95
+ - MIT
96
+ metadata:
97
+ homepage_uri: https://github.com/navut/estated-ruby-client
98
+ source_code_uri: https://github.com/navut/estated-ruby-client
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 2.3.0
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubygems_version: 3.0.6
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: 'Ruby client for Estated API: https://estated.com/developers/docs/v4'
118
+ test_files: []