Class: Spage::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/spage/resources/page.rb

Overview

Page resource in statuspage.io

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Page

rubocop: disable Metrics/MethodLength, Metrics/AbcSize



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/spage/resources/page.rb', line 8

def initialize(attrs)
  @id = attrs['id']
  @created_at = date_parse(attrs['created_at'])
  @updated_at = date_parse(attrs['updated_at'])
  @name = attrs['name']
  @page_description = attrs['page_description']
  @headline = attrs['headline']
  @branding = attrs['branding']
  @subdomain = attrs['subdomain']
  @domain = attrs['domain']
  @url = attrs['url']
  @support_url = attrs['support_url']
  @hidden_from_search = attrs['hidden_from_search']
  @allow_page_subscribers = attrs['allow_page_subscribers']
  @allow_incident_subscribers = attrs['allow_incident_subscribers']
  @allow_email_subscribers = attrs['allow_email_subscribers']
  @allow_sms_subscribers = attrs['allow_sms_subscribers']
  @allow_rss_atom_feeds = attrs['allow_rss_atom_feeds']
  @allow_webhook_subscribers = attrs['allow_webhook_subscribers']
  @notifications_from_email = attrs['notifications_from_email']
  @notifications_email_footer = attrs['notifications_email_footer']
  @activity_score = attrs['activity_score']
  @twitter_username = attrs['twitter_username']
  @viewers_must_be_team_members = attrs['viewers_must_be_team_members']
  @ip_restrictions = attrs['ip_restrictions']
  @city = attrs['city']
  @state = attrs['state']
  @country = attrs['country']
  @time_zone = attrs['time_zone']
  @css_body_background_color = attrs['css_body_background_color']
  @css_font_color = attrs['css_font_color']
  @css_light_font_color = attrs['css_light_font_color']
  @css_greens = attrs['css_greens']
  @css_yellows = attrs['css_yellows']
  @css_oranges = attrs['css_oranges']
  @css_blues = attrs['css_blues']
  @css_reds = attrs['css_reds']
  @css_border_color = attrs['css_border_color']
  @css_graph_color = attrs['css_graph_color']
  @css_link_color = attrs['css_link_color']
  @css_no_data = attrs['css_no_data']
  @favicon_logo = attrs['favicon_logo']
  @transactional_logo = attrs['transactional_logo']
  @hero_cover = attrs['hero_cover']
  @email_logo = attrs['email_logo']
  @twitter_logo = attrs['twitter_logo']
end

Instance Attribute Details

#activity_scoreObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def activity_score
  @activity_score
end

#allow_email_subscribersObject

Returns the value of attribute allow_email_subscribers.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_email_subscribers
  @allow_email_subscribers
end

#allow_incident_subscribersObject

Returns the value of attribute allow_incident_subscribers.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_incident_subscribers
  @allow_incident_subscribers
end

#allow_page_subscribersObject

Returns the value of attribute allow_page_subscribers.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_page_subscribers
  @allow_page_subscribers
end

#allow_rss_atom_feedsObject

Returns the value of attribute allow_rss_atom_feeds.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_rss_atom_feeds
  @allow_rss_atom_feeds
end

#allow_sms_subscribersObject

Returns the value of attribute allow_sms_subscribers.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_sms_subscribers
  @allow_sms_subscribers
end

#allow_webhook_subscribersObject

Returns the value of attribute allow_webhook_subscribers.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def allow_webhook_subscribers
  @allow_webhook_subscribers
end

#brandingObject

Returns the value of attribute branding.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def branding
  @branding
end

#cityObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def city
  @city
end

#countryObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def country
  @country
end

#created_atObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def created_at
  @created_at
end

#css_bluesObject

Returns the value of attribute css_blues.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_blues
  @css_blues
end

#css_body_background_colorObject

Returns the value of attribute css_body_background_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_body_background_color
  @css_body_background_color
end

#css_border_colorObject

Returns the value of attribute css_border_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_border_color
  @css_border_color
end

#css_font_colorObject

Returns the value of attribute css_font_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_font_color
  @css_font_color
end

#css_graph_colorObject

Returns the value of attribute css_graph_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_graph_color
  @css_graph_color
end

#css_greensObject

Returns the value of attribute css_greens.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_greens
  @css_greens
end

#css_light_font_colorObject

Returns the value of attribute css_light_font_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_light_font_color
  @css_light_font_color
end

Returns the value of attribute css_link_color.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_link_color
  @css_link_color
end

#css_no_dataObject

Returns the value of attribute css_no_data.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_no_data
  @css_no_data
end

#css_orangesObject

Returns the value of attribute css_oranges.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_oranges
  @css_oranges
end

#css_redsObject

Returns the value of attribute css_reds.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_reds
  @css_reds
end

#css_yellowsObject

Returns the value of attribute css_yellows.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def css_yellows
  @css_yellows
end

#domainObject

Returns the value of attribute domain.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def domain
  @domain
end

#email_logoObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def 
  @email_logo
end

#favicon_logoObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def 
  @favicon_logo
end

#headlineObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def headline
  @headline
end

#hero_coverObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def hero_cover
  @hero_cover
end

#hidden_from_searchObject

Returns the value of attribute hidden_from_search.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def hidden_from_search
  @hidden_from_search
end

#idObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def id
  @id
end

#ip_restrictionsObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def ip_restrictions
  @ip_restrictions
end

#nameObject

Returns the value of attribute name.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def name
  @name
end

Returns the value of attribute notifications_email_footer.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def notifications_email_footer
  @notifications_email_footer
end

#notifications_from_emailObject

Returns the value of attribute notifications_from_email.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def notifications_from_email
  @notifications_from_email
end

#page_descriptionObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def page_description
  @page_description
end

#stateObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def state
  @state
end

#subdomainObject

Returns the value of attribute subdomain.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def subdomain
  @subdomain
end

#support_urlObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def support_url
  @support_url
end

#time_zoneObject

Returns the value of attribute time_zone.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def time_zone
  @time_zone
end

#transactional_logoObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def 
  @transactional_logo
end

#twitter_logoObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def 
  @twitter_logo
end

#twitter_usernameObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def twitter_username
  @twitter_username
end

#updated_atObject (readonly)

rubocop: disable Layout/LineLength



58
59
60
# File 'lib/spage/resources/page.rb', line 58

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def url
  @url
end

#viewers_must_be_team_membersObject

Returns the value of attribute viewers_must_be_team_members.



60
61
62
# File 'lib/spage/resources/page.rb', line 60

def viewers_must_be_team_members
  @viewers_must_be_team_members
end

Instance Method Details

#date_parse(str) ⇒ Object

rubocop: enable Layout/LineLength



64
65
66
67
68
69
# File 'lib/spage/resources/page.rb', line 64

def date_parse(str)
  return str if str.nil?
  return str if str.is_a?(DateTime)

  DateTime.parse(str)
end