Class: DNApi::Monitoring

Inherits:
Struct
  • Object
show all
Defined in:
lib/dnapi/monitoring.rb

Constant Summary collapse

Monit =
new(:name => "monit", :label => "Monit")
God =
new(:name => "god",   :label => "god")

Instance Attribute Summary collapse

Attributes inherited from Struct

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#==, _many, #_many, #_many_values, _ones, #_ones, #_ones_values, _umembers, belongs_to, from, #initialize, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member

Methods included from Test::Ext

#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick

Constructor Details

This class inherits a constructor from DNApi::Struct

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



2
3
4
# File 'lib/dnapi/monitoring.rb', line 2

def label
  @label
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/dnapi/monitoring.rb', line 2

def name
  @name
end

Class Method Details

.allObject



6
7
8
# File 'lib/dnapi/monitoring.rb', line 6

def self.all
  @all ||= [Monit, God]
end

.get(name) ⇒ Object



10
11
12
# File 'lib/dnapi/monitoring.rb', line 10

def self.get(name)
  all.detect { |m| m.name == name }
end

Instance Method Details

#god?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/dnapi/monitoring.rb', line 18

def god?
  name == "god"
end

#monit?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/dnapi/monitoring.rb', line 14

def monit?
  name == "monit"
end