Class: Ecfr::AdminService::SiteNotification

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

Constant Summary collapse

SITE_NOTIFICATIONS_PATH =
"v1/notifications.json"

Constants inherited from Base

Base::SUPPORTED_ARRAY_ACCESSORS

Instance Attribute Summary collapse

Attributes inherited from Base

#metadata, #request_data, #response_status, #results

Class Method Summary collapse

Methods inherited from Base

base_url, service_name, service_path

Methods inherited from Base

basic_auth_client_options, #each, #initialize, metadata, metadata_key, result_key

Methods included from Extensible

#inherited

Methods included from Ecfr::AttributeMethodDefinition

included, #initialize

Methods inherited from Client

build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge

Methods included from ParallelClient

included

Constructor Details

This class inherits a constructor from Ecfr::Base

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