Class: Serverspec::Type::RabbitmqVhostList

Inherits:
RabbitmqBase show all
Defined in:
lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb

Instance Method Summary collapse

Methods inherited from RabbitmqBase

#initialize, #length

Methods inherited from ApiBase

#[], #initialize

Constructor Details

This class inherits a constructor from Serverspec::Type::RabbitmqBase

Instance Method Details

#has_vhost?(vhost) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb', line 7

def has_vhost?(vhost)
  inspection.find { |str| str['name'] == vhost }
end

#inspectionObject



19
20
21
# File 'lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb', line 19

def inspection
  @inspection ||= ::MultiJson.load(get_inspection.stdout)
end

#to_sObject



11
12
13
# File 'lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb', line 11

def to_s
  'RabbitMQ VHosts List'
end

#urlObject



15
16
17
# File 'lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb', line 15

def url
  "#{@url_base}/api/vhosts"
end