Class: Mackerel::NotificationGroup
- Inherits:
-
Object
- Object
- Mackerel::NotificationGroup
- Defined in:
- lib/mackerel/notification_group.rb
Instance Attribute Summary collapse
-
#childChannelIds ⇒ Object
Returns the value of attribute childChannelIds.
-
#childNotificationGroupIds ⇒ Object
Returns the value of attribute childNotificationGroupIds.
-
#id ⇒ Object
Returns the value of attribute id.
-
#monitors ⇒ Object
Returns the value of attribute monitors.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notificationLevel ⇒ Object
Returns the value of attribute notificationLevel.
-
#services ⇒ Object
Returns the value of attribute services.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ NotificationGroup
constructor
A new instance of NotificationGroup.
- #to_h ⇒ Object
- #to_json(options = nil) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ NotificationGroup
Returns a new instance of NotificationGroup.
5 6 7 8 9 10 11 12 13 |
# File 'lib/mackerel/notification_group.rb', line 5 def initialize(args = {}) @id = args["id"] @name = args["name"] @notificationLevel = args["notificationLevel"] @childNotificationGroupIds = args["childNotificationGroupIds"] @childChannelIds = args["childChannelIds"] @monitors = args["monitors"] @services = args["services"] end |
Instance Attribute Details
#childChannelIds ⇒ Object
Returns the value of attribute childChannelIds.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def childChannelIds @childChannelIds end |
#childNotificationGroupIds ⇒ Object
Returns the value of attribute childNotificationGroupIds.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def childNotificationGroupIds @childNotificationGroupIds end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def id @id end |
#monitors ⇒ Object
Returns the value of attribute monitors.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def monitors @monitors end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def name @name end |
#notificationLevel ⇒ Object
Returns the value of attribute notificationLevel.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def notificationLevel @notificationLevel end |
#services ⇒ Object
Returns the value of attribute services.
4 5 6 |
# File 'lib/mackerel/notification_group.rb', line 4 def services @services end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/mackerel/notification_group.rb', line 15 def to_h instance_variables.flat_map do |name| respond_to?(name[1..-1]) ? [name[1..-1]] : [] end.each_with_object({}) do |name, hash| hash[name] = public_send(name) end.delete_if { |key, val| val == nil } end |
#to_json(options = nil) ⇒ Object
23 24 25 |
# File 'lib/mackerel/notification_group.rb', line 23 def to_json( = nil) return to_h.to_json() end |