Class: Echochamber::WidgetStatus

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echochamber/widget/widget_status.rb

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(params) ⇒ Echochamber::WidgetStatus

Status object

Parameters:

  • [Hash] (Hash)

    a customizable set of options

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :value (String)

    The status to which the widget is to be updated. The possible values for this variable are ENABLE and DISABLE (REQUIRED)

  • :message (String)

    Display this custom message to the user when the widget is accessed. Note that this can contain wiki markup to include clickable links in the message. This is required if redirectUrl is not provided. Both message and redirectUrl can not be specified

  • :redirectUrl (String)

    Redirect the user to this URL when the widget is accessed. This is required if message is not provided. Both message and redirectUrl can not be specified


13
14
15
16
17
# File 'lib/echochamber/widget/widget_status.rb', line 13

def initialize(params)
  require_keys([:value], params)
  require_exactly_one([:message, :redirectUrl], params)
  merge!(params)
end