Class: MythicBeasts::Client
- Inherits:
-
Object
- Object
- MythicBeasts::Client
- Defined in:
- lib/mythic_beasts/client.rb
Constant Summary collapse
- API_BASE_URL =
"https://api.mythic-beasts.com"
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#dns ⇒ Object
readonly
Returns the value of attribute dns.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#vps ⇒ Object
readonly
Returns the value of attribute vps.
Instance Method Summary collapse
- #delete(path, params: {}) ⇒ Object
- #get(path, params: {}) ⇒ Object
-
#initialize(api_key:, api_secret:) ⇒ Client
constructor
A new instance of Client.
- #patch(path, body: {}, params: {}) ⇒ Object
- #post(path, body: {}, params: {}) ⇒ Object
- #put(path, body: {}, params: {}) ⇒ Object
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
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
5 6 7 |
# File 'lib/mythic_beasts/client.rb', line 5 def auth @auth end |
#dns ⇒ Object (readonly)
Returns the value of attribute dns.
5 6 7 |
# File 'lib/mythic_beasts/client.rb', line 5 def dns @dns end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
5 6 7 |
# File 'lib/mythic_beasts/client.rb', line 5 def proxy @proxy end |
#vps ⇒ Object (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 |