class Spage::Component

Page resource in statuspage.io

Attributes

automation_email[R]

rubocop: disable Layout/LineLength

created_at[R]

rubocop: disable Layout/LineLength

description[RW]
group[R]

rubocop: disable Layout/LineLength

group_id[RW]
id[R]

rubocop: disable Layout/LineLength

name[RW]
only_show_if_degraded[RW]
page_id[R]

rubocop: disable Layout/LineLength

position[R]

rubocop: disable Layout/LineLength

showcase[RW]
status[RW]
updated_at[R]

rubocop: disable Layout/LineLength

Public Class Methods

new(attrs) click to toggle source

rubocop: disable Metrics/MethodLength, Metrics/AbcSize

# File lib/spage/resources/component.rb, line 8
def initialize(attrs)
  @id               = attrs['id']
  @page_id          = attrs['page_id']
  @created_at       = attrs['created_at']
  @updated_at       = attrs['updated_at']
  @group            = attrs['group']
  @position         = attrs['position']
  @automation_email = attrs['automation_email']

  # Updatable properties
  @description           = attrs['description']
  @status                = attrs['status']
  @name                  = attrs['name']
  @only_show_if_degraded = attrs['only_show_if_degraded']
  @group_id              = attrs['group_id']
  @showcase              = attrs['showcase']
end

Private Instance Methods

date_parse(str) click to toggle source

rubocop: enable Layout/LineLength

# File lib/spage/resources/component.rb, line 35
def date_parse(str)
  return str if str.nil?
  return str if str.is_a?(DateTime)

  DateTime.parse(str)
end