Class: Getevents::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/getevents/client.rb

Constant Summary collapse

URL =
"https://api.getevents.co"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



6
7
8
9
10
11
12
13
14
15
# File 'lib/getevents/client.rb', line 6

def initialize
  if test_mode?
    @connection = Getevents::FakeClient.new
  else
    @connection = Faraday.new(url: URL) do |faraday|
      faraday.headers["Authorization"] = "GetEvents #{}:#{token}"
      faraday.adapter Faraday.default_adapter
    end
  end
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



4
5
6
# File 'lib/getevents/client.rb', line 4

def connection
  @connection
end

Instance Method Details

#account_idObject



17
18
19
# File 'lib/getevents/client.rb', line 17

def 
  Getevents.configuration.
end

#test_mode?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/getevents/client.rb', line 25

def test_mode?
  Getevents.configuration.test_mode
end

#tokenObject



21
22
23
# File 'lib/getevents/client.rb', line 21

def token
  Getevents.configuration.token
end