Class: YouCanBookMe::Client

Inherits:
Object
  • Object
show all
Includes:
Bookings, Profiles
Defined in:
lib/YouCanBookMe/client.rb,
lib/YouCanBookMe/client/account.rb,
lib/YouCanBookMe/client/bookings.rb,
lib/YouCanBookMe/client/profiles.rb,
lib/YouCanBookMe/client/caligraph.rb,
lib/YouCanBookMe/client/profiles/bookings.rb

Defined Under Namespace

Modules: Account, Bookings, Caligraph, Profiles

Constant Summary

Constants included from YouCanBookMe::Connection::API

YouCanBookMe::Connection::API::BASE_URL

Instance Method Summary collapse

Methods included from Bookings

#index

Methods included from Profiles

#create, #destroy, #index, #show, #update

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
17
18
19
# File 'lib/YouCanBookMe/client.rb', line 11

def initialize(options = {})
  email = options[:email] || ENV['YOUCANBOOKME_EMAIL']
  password = options[:password] || ENV['YOUCANBOOKME_PASSWORD']

  raise YouCanBookMe::AuthorizationNotSpecified if email.empty? || password.empty?

  YouCanBookMe.instance_variable_set(:@email, email)
  YouCanBookMe.instance_variable_set(:@password, password)
end