Class: Moxprox::Cluster
- Inherits:
-
Object
- Object
- Moxprox::Cluster
- Defined in:
- lib/moxprox/cluster.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Cluster
constructor
A new instance of Cluster.
- #node(name) ⇒ Object
- #request(path, method = "get", query = {}) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Cluster
5 6 7 8 |
# File 'lib/moxprox/cluster.rb', line 5 def initialize(opts = {}) @ticket = Ticket.login(opts.fetch(:host), opts.fetch(:username), opts.fetch(:password)) @logger = opts[:logger] || NullLoger.new end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
3 4 5 |
# File 'lib/moxprox/cluster.rb', line 3 def logger @logger end |
Instance Method Details
#node(name) ⇒ Object
10 11 12 |
# File 'lib/moxprox/cluster.rb', line 10 def node(name) Node.new(self, name) end |
#request(path, method = "get", query = {}) ⇒ Object
14 15 16 |
# File 'lib/moxprox/cluster.rb', line 14 def request(path, method = "get", query = {}) Request.new(path, method, query).perform(@ticket) end |