Class: Ecfr::AdminService::SiteNotification
- 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
-
#location ⇒ String
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).
-
#message ⇒ String
readonly
notification content.
-
#notification_type ⇒ String
readonly
where the notification should be displayed; one of ‘basic’, ‘error’, ‘feature’, ‘info’, ‘special’, or ‘warning’.
- #user_dismissible ⇒ Boolean readonly
Attributes inherited from Base
#metadata, #request_data, #response_status, #results
Class Method Summary collapse
-
.all ⇒ [<SiteNotification>]
Retrieves all active notifications.
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
Methods included from Ecfr::AttributeMethodDefinition
Methods inherited from Client
build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge
Methods included from ParallelClient
Constructor Details
This class inherits a constructor from Ecfr::Base
Instance Attribute Details
#location ⇒ String (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)
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)" |
#message ⇒ String (readonly)
notification content
6 7 |
# File 'lib/ecfr/admin_service/site_notification.rb', line 6 attribute :message, desc: "notification content" |
#notification_type ⇒ String (readonly)
where the notification should be displayed; one of ‘basic’, ‘error’, ‘feature’, ‘info’, ‘special’, or ‘warning’
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_dismissible ⇒ Boolean (readonly)
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
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 |