module YouCanBookMe::Connection::Caligraph
Constants
- BASE_URL
Protected Instance Methods
delete(path, data)
click to toggle source
# File lib/YouCanBookMe/connection/caligraph.rb, line 38 def delete(path, data) email = YouCanBookMe.instance_variable_get(:@email) password = YouCanBookMe.instance_variable_get(:@password) response = HTTP.basic_auth(user: email, pass: password).delete(Addressable::URI.parse(BASE_URL + email + path.to_s).normalize.to_s, json: data) YouCanBookMe::Error.raise_from(response) response.parse end
get(path, data)
click to toggle source
# File lib/YouCanBookMe/connection/caligraph.rb, line 14 def get(path, data) email = YouCanBookMe.instance_variable_get(:@email) password = YouCanBookMe.instance_variable_get(:@password) response = HTTP.basic_auth(user: email, pass: password).get(Addressable::URI.parse(BASE_URL + email + path.to_s).normalize.to_s, params: data) YouCanBookMe::Error.raise_from(response) response.parse end
post(path, data)
click to toggle source
# File lib/YouCanBookMe/connection/caligraph.rb, line 22 def post(path, data) email = YouCanBookMe.instance_variable_get(:@email) password = YouCanBookMe.instance_variable_get(:@password) response = HTTP.basic_auth(user: email, pass: password).post(Addressable::URI.parse(BASE_URL + email + path.to_s).normalize.to_s, json: data) YouCanBookMe::Error.raise_from(response) response.parse end
put(path, data)
click to toggle source
# File lib/YouCanBookMe/connection/caligraph.rb, line 30 def put(path, data) email = YouCanBookMe.instance_variable_get(:@email) password = YouCanBookMe.instance_variable_get(:@password) response = HTTP.basic_auth(user: email, pass: password).put(Addressable::URI.parse(BASE_URL + email + path.to_s).normalize.to_s, json: data) YouCanBookMe::Error.raise_from(response) response.parse end