class RDStation::Client

Public Class Methods

new(access_token:, refresh_token: nil) click to toggle source
# File lib/rdstation/client.rb, line 3
def initialize(access_token:, refresh_token: nil)
  warn_deprecation unless refresh_token
  @authorization = Authorization.new(
    access_token: access_token,
    refresh_token: refresh_token
  )
end

Public Instance Methods

contacts() click to toggle source
# File lib/rdstation/client.rb, line 11
def contacts
  @contacts ||= RDStation::Contacts.new(authorization: @authorization)
end
events() click to toggle source
# File lib/rdstation/client.rb, line 15
def events
  @events ||= RDStation::Events.new(authorization: @authorization)
end
fields() click to toggle source
# File lib/rdstation/client.rb, line 19
def fields
  @fields ||= RDStation::Fields.new(authorization: @authorization)
end
webhooks() click to toggle source
# File lib/rdstation/client.rb, line 23
def webhooks
  @webhooks ||= RDStation::Webhooks.new(authorization: @authorization)
end

Private Instance Methods

warn_deprecation() click to toggle source
# File lib/rdstation/client.rb, line 29
def warn_deprecation
  warn "DEPRECATION WARNING: Specifying refresh_token in RDStation::Client.new(access_token: 'at', refresh_token: 'rt') is optional right now, but will be mandatory in future versions. "
end