Class: MythicBeasts::Client

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

Constant Summary collapse

API_BASE_URL =
"https://api.mythic-beasts.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, api_secret:) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
# File 'lib/mythic_beasts/client.rb', line 7

def initialize(api_key:, api_secret:)
  @auth = Auth.new(api_key: api_key, api_secret: api_secret)
  @dns = DNS.new(self)
  @vps = VPS.new(self)
  @proxy = Proxy.new(self)
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



5
6
7
# File 'lib/mythic_beasts/client.rb', line 5

def auth
  @auth
end

#dnsObject (readonly)

Returns the value of attribute dns.



5
6
7
# File 'lib/mythic_beasts/client.rb', line 5

def dns
  @dns
end

#proxyObject (readonly)

Returns the value of attribute proxy.



5
6
7
# File 'lib/mythic_beasts/client.rb', line 5

def proxy
  @proxy
end

#vpsObject (readonly)

Returns the value of attribute vps.



5
6
7
# File 'lib/mythic_beasts/client.rb', line 5

def vps
  @vps
end

Instance Method Details

#delete(path, params: {}) ⇒ Object



30
31
32
# File 'lib/mythic_beasts/client.rb', line 30

def delete(path, params: {})
  request(:delete, path, params: params)
end

#get(path, params: {}) ⇒ Object



14
15
16
# File 'lib/mythic_beasts/client.rb', line 14

def get(path, params: {})
  request(:get, path, params: params)
end

#patch(path, body: {}, params: {}) ⇒ Object



26
27
28
# File 'lib/mythic_beasts/client.rb', line 26

def patch(path, body: {}, params: {})
  request(:patch, path, body: body, params: params)
end

#post(path, body: {}, params: {}) ⇒ Object



18
19
20
# File 'lib/mythic_beasts/client.rb', line 18

def post(path, body: {}, params: {})
  request(:post, path, body: body, params: params)
end

#put(path, body: {}, params: {}) ⇒ Object



22
23
24
# File 'lib/mythic_beasts/client.rb', line 22

def put(path, body: {}, params: {})
  request(:put, path, body: body, params: params)
end