Class: Ecfr::AdminService::SiteNotification

Inherits:
Base
  • Object
show all
Defined in:
lib/ecfr/admin_service/site_notification.rb

Constant Summary collapse

SITE_NOTIFICATIONS_PATH =
"v1/notifications.json"

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

base_url, service_name, service_path

Instance Attribute Details

#locationString (readonly)

the location on eCFR.gov that notification will be displayed; one of 'all', 'content', 'search' or 'table_of_contents' ('top' is the only possible value for the 'special' type)

Returns:

  • (String)


11
12
13
14
# File 'lib/ecfr/admin_service/site_notification.rb', line 11

attribute :location,
        desc: "the location on eCFR.gov that notification will be displayed;
one of 'all', 'content', 'search' or 'table_of_contents'
('top' is the only possible value for the 'special' type)"

#messageString (readonly)

notification content

Returns:

  • (String)


6
7
# File 'lib/ecfr/admin_service/site_notification.rb', line 6

attribute :message,
desc: "notification content"

#notification_typeString (readonly)

where the notification should be displayed; one of 'basic', 'error', 'feature', 'info', 'special', or 'warning'

Returns:

  • (String)


8
9
10
# File 'lib/ecfr/admin_service/site_notification.rb', line 8

attribute :notification_type,
        desc: "where the notification should be displayed;
one of 'basic', 'error', 'feature', 'info', 'special', or 'warning'"

#user_dismissibleBoolean (readonly)

Returns:

  • (Boolean)


16
17
# File 'lib/ecfr/admin_service/site_notification.rb', line 16

attribute :user_dismissible,
type: :boolean

Class Method Details

.all[<SiteNotification>]

Retrieves all active notifications

Returns:



26
27
28
29
30
31
# File 'lib/ecfr/admin_service/site_notification.rb', line 26

def self.all
  perform(
    :get,
    SITE_NOTIFICATIONS_PATH
  )
end