Class: RubyOctopus::OctopusConnection
- Inherits:
-
Object
- Object
- RubyOctopus::OctopusConnection
- Defined in:
- lib/rubyoctopus/octopusconnection.rb
Overview
Base class to use to perform actions against an Octopus instance.
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Users might want to check which domain an instance is targeting.
Instance Method Summary collapse
- #get(resource_type) ⇒ Object
-
#initialize(url, api_key) ⇒ OctopusConnection
constructor
A new instance of OctopusConnection.
Constructor Details
#initialize(url, api_key) ⇒ OctopusConnection
Returns a new instance of OctopusConnection.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rubyoctopus/octopusconnection.rb', line 12 def initialize(url, api_key) @url = url @conn = Faraday.new( url: url, headers: { "X-Octopus-ApiKey": api_key } ) do |faraday| faraday.adapter Faraday.default_adapter faraday.response :json end end |
Instance Attribute Details
#url ⇒ Object (readonly)
Users might want to check which domain an instance is targeting.
10 11 12 |
# File 'lib/rubyoctopus/octopusconnection.rb', line 10 def url @url end |
Instance Method Details
#get(resource_type) ⇒ Object
23 24 25 |
# File 'lib/rubyoctopus/octopusconnection.rb', line 23 def get(resource_type) @conn.get(resource_type) end |