Module: ZohoHub
- Defined in:
- lib/zoho_hub.rb,
lib/zoho_hub/auth.rb,
lib/zoho_hub/errors.rb,
lib/zoho_hub/version.rb,
lib/zoho_hub/response.rb,
lib/zoho_hub/connection.rb,
lib/zoho_hub/configuration.rb,
lib/zoho_hub/records/quote.rb,
lib/zoho_hub/records/vendor.rb,
lib/zoho_hub/records/account.rb,
lib/zoho_hub/records/contact.rb,
lib/zoho_hub/records/product.rb,
lib/zoho_hub/records/campaign.rb,
lib/zoho_hub/records/potential.rb,
lib/zoho_hub/records/attachment.rb,
lib/zoho_hub/records/base_record.rb,
lib/zoho_hub/records/sms_message.rb,
lib/zoho_hub/records/credit_score.rb,
lib/zoho_hub/records/adverse_criteria.rb
Defined Under Namespace
Classes: Account, AdverseCriteria, Attachment, AttachmentLinkTakenError, Auth, BaseRecord, Campaign, Configuration, Connection, Contact, CreditScore, InvalidTokenError, Potential, Product, Quote, RecordInvalid, RecordNotFound, Response, SMSMessage, Vendor, ZohoAPIError
Constant Summary
collapse
- VERSION =
'0.1.43'
Class Method Summary
collapse
Class Method Details
.access_token? ⇒ Boolean
52
53
54
55
56
|
# File 'lib/zoho_hub.rb', line 52
def access_token?
return false unless connection.present?
connection.access_token?
end
|
.configuration ⇒ Object
26
27
28
|
# File 'lib/zoho_hub.rb', line 26
def configuration
@configuration ||= Configuration.new
end
|
58
59
60
|
# File 'lib/zoho_hub.rb', line 58
def configure
yield(configuration)
end
|
.connection ⇒ Object
30
31
32
|
# File 'lib/zoho_hub.rb', line 30
def connection
@connection
end
|
.on_refresh(&block) ⇒ Object
34
35
36
|
# File 'lib/zoho_hub.rb', line 34
def on_refresh(&block)
@connection.on_refresh_cb = block
end
|
.refresh_token? ⇒ Boolean
46
47
48
49
50
|
# File 'lib/zoho_hub.rb', line 46
def refresh_token?
return false unless connection.present?
connection.refresh_token?
end
|
.setup_connection(params = {}) ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/zoho_hub.rb', line 38
def setup_connection(params = {})
raise "ERROR: #{params[:error]}" if params[:error]
connection_params = params.slice(:access_token, :expires_in, :api_domain, :refresh_token)
@connection = Connection.new(connection_params)
end
|