honest_renter 0.0.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile.lock +23 -1
  5. data/LICENSE.txt +22 -0
  6. data/README.md +116 -1
  7. data/Rakefile +11 -0
  8. data/honest_renter.gemspec +6 -1
  9. data/lib/authenticator.rb +76 -0
  10. data/lib/client.rb +11 -0
  11. data/lib/honest_renter.rb +12 -0
  12. data/lib/request.rb +71 -0
  13. data/lib/requests/expandable.rb +10 -0
  14. data/lib/requests/filter.rb +9 -0
  15. data/lib/requests/find_all.rb +27 -0
  16. data/lib/requests/find_all_by_filter.rb +38 -0
  17. data/lib/requests/find_by_id.rb +23 -0
  18. data/lib/requests/post.rb +15 -0
  19. data/lib/requires.rb +18 -0
  20. data/lib/response.rb +30 -0
  21. data/lib/session.rb +20 -0
  22. data/models/applicant.rb +42 -0
  23. data/models/base_model.rb +57 -0
  24. data/models/candidate.rb +31 -0
  25. data/models/child.rb +20 -0
  26. data/models/code.rb +27 -0
  27. data/models/cooccupant.rb +20 -0
  28. data/models/country.rb +16 -0
  29. data/models/email.rb +21 -0
  30. data/models/emergency_contact.rb +20 -0
  31. data/models/ethnicity.rb +16 -0
  32. data/models/failed_login.rb +21 -0
  33. data/models/gender.rb +16 -0
  34. data/models/inbox_filters.rb +26 -0
  35. data/models/invite_settings.rb +23 -0
  36. data/models/member.rb +24 -0
  37. data/models/name.rb +22 -0
  38. data/models/notification.rb +18 -0
  39. data/models/notification_type.rb +19 -0
  40. data/models/organization.rb +23 -0
  41. data/models/participant.rb +21 -0
  42. data/models/person.rb +30 -0
  43. data/models/pet.rb +22 -0
  44. data/models/pet_age_category.rb +18 -0
  45. data/models/pet_size_category.rb +18 -0
  46. data/models/pet_type.rb +18 -0
  47. data/models/phone.rb +24 -0
  48. data/models/phone_type.rb +18 -0
  49. data/models/position.rb +23 -0
  50. data/models/reason_for_archive.rb +18 -0
  51. data/models/reason_for_eviction.rb +18 -0
  52. data/models/reason_for_exclusion.rb +18 -0
  53. data/models/reference.rb +20 -0
  54. data/models/relationship_type.rb +19 -0
  55. data/models/reminder.rb +19 -0
  56. data/models/residence.rb +25 -0
  57. data/models/smoking_status_category.rb +18 -0
  58. data/models/sort_by_option.rb +18 -0
  59. data/models/time_of_day.rb +18 -0
  60. data/models/title.rb +17 -0
  61. data/models/user.rb +20 -0
  62. data/models/vehicle.rb +21 -0
  63. data/modules/requests_unsupported.rb +21 -0
  64. data/modules/unrequestable.rb +23 -0
  65. data/test/fixtures/ethnicities/find_all.json +38 -0
  66. data/test/fixtures/members/find.json +31 -0
  67. data/test/fixtures/titles/find_all_by_filters.json +11 -0
  68. data/test/integration/find_all_by_filters_test.rb +12 -0
  69. data/test/integration/find_all_test.rb +11 -0
  70. data/test/integration/find_test.rb +10 -0
  71. data/test/lib/authenticator_test.rb +75 -0
  72. data/test/lib/requests/filter_test.rb +14 -0
  73. data/test/lib/requests/find_all_by_filter_test.rb +44 -0
  74. data/test/lib/requests/find_all_test.rb +59 -0
  75. data/test/lib/requests/find_by_id_test.rb +30 -0
  76. data/test/lib/requests/post_test.rb +38 -0
  77. data/test/lib/response_test.rb +46 -0
  78. data/test/lib/session_test.rb +45 -0
  79. data/test/models/base_model_test.rb +62 -0
  80. data/test/test_helper.rb +76 -0
  81. data/version.rb +1 -1
  82. metadata +134 -2
@@ -0,0 +1,16 @@
1
+ module HonestRenter
2
+ class Ethnicity < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ class << self
11
+ def attr_name
12
+ 'ethnicities'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module HonestRenter
2
+ class FailedLogin < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :binary_ip,
6
+ :created,
7
+ :ip_address,
8
+ :target
9
+ ].freeze
10
+
11
+ attr_accessor *ATTRIBUTES
12
+
13
+ include Unrequestable
14
+
15
+ class << self
16
+ def attr_name
17
+ 'failed_logins'
18
+ end
19
+ end
20
+ end
21
+ end
data/models/gender.rb ADDED
@@ -0,0 +1,16 @@
1
+ module HonestRenter
2
+ class Gender < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ class << self
11
+ def attr_name
12
+ 'genders'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,26 @@
1
+ module HonestRenter
2
+ class InboxFilters < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :account,
6
+ :ascending,
7
+ :location,
8
+ :max_results,
9
+ :show_archived,
10
+ :sort_by,
11
+ :unit,
12
+ :within_date,
13
+ :within_days
14
+ ].freeze
15
+
16
+ attr_accessor *ATTRIBUTES
17
+
18
+ include Unrequestable
19
+
20
+ class << self
21
+ def attr_name
22
+ 'inbox_filters'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,23 @@
1
+ module HonestRenter
2
+ class InviteSettings < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :account,
6
+ :assessment,
7
+ :location,
8
+ :message,
9
+ :method,
10
+ :unit
11
+ ].freeze
12
+
13
+ attr_accessor *ATTRIBUTES
14
+
15
+ include Unrequestable
16
+
17
+ class << self
18
+ def attr_name
19
+ 'invite_settings'
20
+ end
21
+ end
22
+ end
23
+ end
data/models/member.rb ADDED
@@ -0,0 +1,24 @@
1
+ require_relative 'person'
2
+
3
+ module HonestRenter
4
+ class Member < Person
5
+ ATTRIBUTES = [
6
+ :id,
7
+ :has_password,
8
+ :inbox_filters,
9
+ :invite_settings,
10
+ :is_system_admin,
11
+ :password,
12
+ :send_reports_by_email,
13
+ :users
14
+ ].freeze
15
+
16
+ attr_accessor *ATTRIBUTES
17
+
18
+ class << self
19
+ def attr_name
20
+ 'members'
21
+ end
22
+ end
23
+ end
24
+ end
data/models/name.rb ADDED
@@ -0,0 +1,22 @@
1
+ module HonestRenter
2
+ class Name < BaseModel
3
+ ATTRIBUTES = [
4
+ :title,
5
+ :first,
6
+ :middle,
7
+ :last,
8
+ :previous_last,
9
+ :suffix
10
+ ].freeze
11
+
12
+ attr_accessor *ATTRIBUTES
13
+
14
+ include Unrequestable
15
+
16
+ class << self
17
+ def attr_name
18
+ 'names'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class Notification < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :person,
6
+ :type,
7
+ :subscribed
8
+ ].freeze
9
+
10
+ attr_accessor *ATTRIBUTES
11
+
12
+ class << self
13
+ def attr_name
14
+ 'notifications'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ module HonestRenter
2
+ class NotificationType < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label,
6
+ :active
7
+ ].freeze
8
+
9
+ attr_accessor *ATTRIBUTES
10
+
11
+ include Unrequestable
12
+
13
+ class << self
14
+ def attr_name
15
+ 'notification_types'
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ module HonestRenter
2
+ class Organization < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :accounts_with_access,
6
+ :added_by,
7
+ :name,
8
+ :emails,
9
+ :phones,
10
+ :positions,
11
+ :preferred_email,
12
+ :preferred_phone
13
+ ].freeze
14
+
15
+ attr_accessor *ATTRIBUTES
16
+
17
+ class << self
18
+ def attr_name
19
+ 'organizations'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ module HonestRenter
2
+ class Participant < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :administration,
6
+ :assessments,
7
+ :custom_id,
8
+ :password,
9
+ :results,
10
+ :study
11
+ ].freeze
12
+
13
+ attr_accessor *ATTRIBUTES
14
+
15
+ class << self
16
+ def attr_name
17
+ 'participants'
18
+ end
19
+ end
20
+ end
21
+ end
data/models/person.rb ADDED
@@ -0,0 +1,30 @@
1
+ module HonestRenter
2
+ class Person < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :accounts_with_access,
6
+ :birthdate,
7
+ :created,
8
+ :date_to_delete_identifying_info,
9
+ :ethnicities,
10
+ :emails,
11
+ :gender,
12
+ :name,
13
+ :notes,
14
+ :notifications,
15
+ :other_ethnicity,
16
+ :phones,
17
+ :positions,
18
+ :preferred_email,
19
+ :preferred_phone
20
+ ].freeze
21
+
22
+ attr_accessor *ATTRIBUTES
23
+
24
+ class << self
25
+ def attr_name
26
+ 'persons'
27
+ end
28
+ end
29
+ end
30
+ end
data/models/pet.rb ADDED
@@ -0,0 +1,22 @@
1
+ module HonestRenter
2
+ class Pet < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :age_category,
6
+ :breed,
7
+ :created,
8
+ :other_type,
9
+ :owner,
10
+ :size,
11
+ :type
12
+ ].freeze
13
+
14
+ attr_accessor *ATTRIBUTES
15
+
16
+ class << self
17
+ def attr_name
18
+ 'pets'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class PetAgeCategory < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ include Unrequestable
11
+
12
+ class << self
13
+ def attr_name
14
+ 'pet_age_categories'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class PetSizeCategory < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ include Unrequestable
11
+
12
+ class << self
13
+ def attr_name
14
+ 'pet_size_categories'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class PetType < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ include Unrequestable
11
+
12
+ class << self
13
+ def attr_name
14
+ 'pet_types'
15
+ end
16
+ end
17
+ end
18
+ end
data/models/phone.rb ADDED
@@ -0,0 +1,24 @@
1
+ module HonestRenter
2
+ class Phone < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :country_code,
6
+ :created,
7
+ :extension,
8
+ :flagged,
9
+ :number,
10
+ :formatted,
11
+ :organization,
12
+ :person,
13
+ :type
14
+ ].freeze
15
+
16
+ attr_accessor *ATTRIBUTES
17
+
18
+ class << self
19
+ def attr_name
20
+ 'phones'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class PhoneType < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ include Unrequestable
11
+
12
+ class << self
13
+ def attr_name
14
+ 'phone_types'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ module HonestRenter
2
+ class Position < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :annual_income,
6
+ :created,
7
+ :end_date,
8
+ :organization,
9
+ :person,
10
+ :references,
11
+ :start_date,
12
+ :title
13
+ ].freeze
14
+
15
+ attr_accessor *ATTRIBUTES
16
+
17
+ class << self
18
+ def attr_name
19
+ 'positions'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ module HonestRenter
2
+ class ReasonForArchive < BaseModel
3
+ ATTRIBUTES = [
4
+ :id,
5
+ :label
6
+ ].freeze
7
+
8
+ attr_accessor *ATTRIBUTES
9
+
10
+ include Unrequestable
11
+
12
+ class << self
13
+ def attr_name
14
+ 'reasons_for_archive'
15
+ end
16
+ end
17
+ end
18
+ end