Class: DoorLoop::Client
- Inherits:
-
Object
- Object
- DoorLoop::Client
- Defined in:
- lib/doorloop/client.rb
Instance Attribute Summary collapse
-
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#retry_on_rate_limit ⇒ Object
Returns the value of attribute retry_on_rate_limit.
Instance Method Summary collapse
- #accounts ⇒ Object
- #communication_logs ⇒ Object
- #delete(path) ⇒ Object
- #expenses ⇒ Object
- #files ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(api_token, api_base_url: 'https://app.doorloop.com/api/', retry_on_rate_limit: false) ⇒ Client
constructor
A new instance of Client.
- #lease_charges ⇒ Object
- #lease_credits ⇒ Object
- #lease_payments ⇒ Object
- #lease_returned_payments ⇒ Object
- #leases ⇒ Object
- #notes ⇒ Object
- #owners ⇒ Object
- #portfolios ⇒ Object
- #post(path, payload) ⇒ Object
- #properties ⇒ Object
- #put(path, payload) ⇒ Object
- #reports ⇒ Object
- #tasks ⇒ Object
- #tenants ⇒ Object
- #units ⇒ Object
- #users ⇒ Object
- #vendor_bills ⇒ Object
- #vendor_credits ⇒ Object
- #vendors ⇒ Object
Constructor Details
#initialize(api_token, api_base_url: 'https://app.doorloop.com/api/', retry_on_rate_limit: false) ⇒ Client
Returns a new instance of Client.
34 35 36 37 38 39 40 |
# File 'lib/doorloop/client.rb', line 34 def initialize(api_token, api_base_url: 'https://app.doorloop.com/api/', retry_on_rate_limit: false) @api_token = api_token @api_base_url = api_base_url @retry_on_rate_limit = retry_on_rate_limit @logger = Logger.new($stdout) @error_handler = DoorLoop::ErrorHandler.new(@logger, self) end |
Instance Attribute Details
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
32 33 34 |
# File 'lib/doorloop/client.rb', line 32 def api_base_url @api_base_url end |
#api_token ⇒ Object
Returns the value of attribute api_token.
32 33 34 |
# File 'lib/doorloop/client.rb', line 32 def api_token @api_token end |
#logger ⇒ Object
Returns the value of attribute logger.
32 33 34 |
# File 'lib/doorloop/client.rb', line 32 def logger @logger end |
#retry_on_rate_limit ⇒ Object
Returns the value of attribute retry_on_rate_limit.
32 33 34 |
# File 'lib/doorloop/client.rb', line 32 def retry_on_rate_limit @retry_on_rate_limit end |
Instance Method Details
#accounts ⇒ Object
42 43 44 |
# File 'lib/doorloop/client.rb', line 42 def accounts Accounts.new(self) end |
#communication_logs ⇒ Object
122 123 124 |
# File 'lib/doorloop/client.rb', line 122 def communication_logs CommunicationLogs.new(self) end |
#delete(path) ⇒ Object
144 145 146 147 148 |
# File 'lib/doorloop/client.rb', line 144 def delete(path) url = build_url(path) response = make_delete_request(url) parse_response(response) end |
#expenses ⇒ Object
98 99 100 |
# File 'lib/doorloop/client.rb', line 98 def expenses Expenses.new(self) end |
#files ⇒ Object
118 119 120 |
# File 'lib/doorloop/client.rb', line 118 def files Files.new(self) end |
#get(path, options = {}) ⇒ Object
126 127 128 129 130 |
# File 'lib/doorloop/client.rb', line 126 def get(path, = {}) url = build_url(path, ) response = make_request(url) parse_response(response) end |
#lease_charges ⇒ Object
74 75 76 |
# File 'lib/doorloop/client.rb', line 74 def lease_charges LeaseCharges.new(self) end |
#lease_credits ⇒ Object
78 79 80 |
# File 'lib/doorloop/client.rb', line 78 def lease_credits LeaseCredits.new(self) end |
#lease_payments ⇒ Object
66 67 68 |
# File 'lib/doorloop/client.rb', line 66 def lease_payments LeasePayments.new(self) end |
#lease_returned_payments ⇒ Object
70 71 72 |
# File 'lib/doorloop/client.rb', line 70 def lease_returned_payments LeaseReturnedPayments.new(self) end |
#leases ⇒ Object
58 59 60 |
# File 'lib/doorloop/client.rb', line 58 def leases Leases.new(self) end |
#notes ⇒ Object
114 115 116 |
# File 'lib/doorloop/client.rb', line 114 def notes Notes.new(self) end |
#owners ⇒ Object
90 91 92 |
# File 'lib/doorloop/client.rb', line 90 def owners Owners.new(self) end |
#portfolios ⇒ Object
82 83 84 |
# File 'lib/doorloop/client.rb', line 82 def portfolios Portfolios.new(self) end |
#post(path, payload) ⇒ Object
132 133 134 135 136 |
# File 'lib/doorloop/client.rb', line 132 def post(path, payload) url = build_url(path) response = make_post_request(url, payload) parse_response(response) end |
#properties ⇒ Object
46 47 48 |
# File 'lib/doorloop/client.rb', line 46 def properties Properties.new(self) end |
#put(path, payload) ⇒ Object
138 139 140 141 142 |
# File 'lib/doorloop/client.rb', line 138 def put(path, payload) url = build_url(path) response = make_put_request(url, payload) parse_response(response) end |
#reports ⇒ Object
110 111 112 |
# File 'lib/doorloop/client.rb', line 110 def reports Reports.new(self) end |
#tasks ⇒ Object
86 87 88 |
# File 'lib/doorloop/client.rb', line 86 def tasks Tasks.new(self) end |
#tenants ⇒ Object
62 63 64 |
# File 'lib/doorloop/client.rb', line 62 def tenants Tenants.new(self) end |
#units ⇒ Object
50 51 52 |
# File 'lib/doorloop/client.rb', line 50 def units Units.new(self) end |
#users ⇒ Object
54 55 56 |
# File 'lib/doorloop/client.rb', line 54 def users Users.new(self) end |
#vendor_bills ⇒ Object
102 103 104 |
# File 'lib/doorloop/client.rb', line 102 def vendor_bills VendorBills.new(self) end |
#vendor_credits ⇒ Object
106 107 108 |
# File 'lib/doorloop/client.rb', line 106 def vendor_credits VendorCredits.new(self) end |
#vendors ⇒ Object
94 95 96 |
# File 'lib/doorloop/client.rb', line 94 def vendors Vendors.new(self) end |