Sha256: 6f67a9825a98729e149771e8da81f23e9457ee9b701e2d40d3004367d06775ee

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

module RDStation
  class Client
    def initialize(access_token:, refresh_token: nil)
      warn_deprecation unless refresh_token
      @authorization = Authorization.new(
        access_token: access_token,
        refresh_token: refresh_token
      )
    end

    def contacts
      @contacts ||= RDStation::Contacts.new(authorization: @authorization)
    end

    def events
      @events ||= RDStation::Events.new(authorization: @authorization)
    end

    def fields
      @fields ||= RDStation::Fields.new(authorization: @authorization)
    end

    def webhooks
      @webhooks ||= RDStation::Webhooks.new(authorization: @authorization)
    end

    def segmentations
      @segmentations ||= RDStation::Segmentations.new(authorization: @authorization)
    end

    def emails
      @emails ||= RDStation::Emails.new(authorization: @authorization)
    end

    def analytics
      @analytics ||= RDStation::Analytics.new(authorization: @authorization)
    end

    def landing_pages
      @landing_pages ||= RDStation::LandingPages.new(authorization: @authorization)
    end

    private

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.8.2 lib/rdstation/client.rb
rdstation-ruby-client-2.8.1 lib/rdstation/client.rb
rdstation-ruby-client-2.8.0 lib/rdstation/client.rb