Class: Infoblox::Connection
- Inherits:
-
Object
- Object
- Infoblox::Connection
- Defined in:
- lib/infoblox/connection.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#host ⇒ Object
Returns the value of attribute host.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#ssl_opts ⇒ Object
Returns the value of attribute ssl_opts.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #delete(href) ⇒ Object
- #get(href, params = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ Connection
constructor
A new instance of Connection.
- #post(href, body) ⇒ Object
- #put(href, body) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Connection
Returns a new instance of Connection.
35 36 37 38 39 40 41 |
# File 'lib/infoblox/connection.rb', line 35 def initialize(opts={}) self.username = opts[:username] self.password = opts[:password] self.host = opts[:host] self.logger = opts[:logger] self.ssl_opts = opts[:ssl_opts] end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def connection @connection end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def host @host end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def password @password end |
#ssl_opts ⇒ Object
Returns the value of attribute ssl_opts.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def ssl_opts @ssl_opts end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/infoblox/connection.rb', line 3 def username @username end |
Instance Method Details
#delete(href) ⇒ Object
29 30 31 32 33 |
# File 'lib/infoblox/connection.rb', line 29 def delete(href) wrap do connection.delete(href) end end |
#get(href, params = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/infoblox/connection.rb', line 5 def get(href, params={}) wrap do connection.get(href, params) end end |
#post(href, body) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/infoblox/connection.rb', line 11 def post(href, body) wrap do connection.post do |req| req.url href req.body = body.to_json end end end |
#put(href, body) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/infoblox/connection.rb', line 20 def put(href, body) wrap do connection.put do |req| req.url href req.body = body.to_json end end end |