Module: BWAPI::Client::CommandCenter::Displays::Messages

Included in:
BWAPI::Client::CommandCenter::Displays
Defined in:
lib/bwapi/client/command_center/displays/messages.rb

Overview

Displays module for commandcenter/displays/messages endpoints

Instance Method Summary collapse

Instance Method Details

#create_message(display_id, opts = {}) ⇒ Hash

Create a new display message

Parameters:

  • display_id (Integer)

    The display id

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • id (Integer)

    The id of message

  • displayId (Integer)

    The display id

  • title (String)

    The message title

  • type (String)

    The message type

  • content (String)

    The message content

  • duration (Integer)

    The message duration

  • active (Boolean)

    Whether message is active

  • enabled (Boolean)

    Whether message is enabled

  • screenIds (Array)

    ScreenIds where message is shown

Returns:

  • (Hash)

    New display message



38
39
40
# File 'lib/bwapi/client/command_center/displays/messages.rb', line 38

def create_message(display_id, opts = {})
  post "commandcenter/displays/#{display_id}/message", opts
end

#delete_message(display_id, message_id) ⇒ Hash

Delete an existing display message

Parameters:

  • display_id (Integer)

    The display id

  • message_id (Integer)

    The message id

Returns:

  • (Hash)

    Deleted display message



65
66
67
# File 'lib/bwapi/client/command_center/displays/messages.rb', line 65

def delete_message(display_id, message_id)
  delete "commandcenter/displays/#{display_id}/messages/#{message_id}"
end

#get_message(display_id, message_id) ⇒ Hash

Get an existing display message

Parameters:

  • display_id (Integer)

    The display id

  • message_id (Integer)

    The message id

Returns:

  • (Hash)

    Specific message for display



20
21
22
# File 'lib/bwapi/client/command_center/displays/messages.rb', line 20

def get_message(display_id, message_id)
  get "commandcenter/displays/#{display_id}/messages/#{message_id}"
end

#messages(display_id) ⇒ Hash

Get the messages for an existing display

Parameters:

  • display_id (Integer)

    The display id

Returns:

  • (Hash)

    All messages for display



11
12
13
# File 'lib/bwapi/client/command_center/displays/messages.rb', line 11

def messages(display_id)
  get "commandcenter/displays/#{display_id}/messages"
end

#update_message(display_id, message_id, opts = {}) ⇒ Hash

Update an existing display message

Parameters:

  • display_id (Integer)

    The display id

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • id (Integer)

    The id of message

  • displayId (Integer)

    The display id

  • title (String)

    The message title

  • type (String)

    The message type

  • content (String)

    The message content

  • duration (Integer)

    The message duration

  • active (Boolean)

    Whether message is active

  • enabled (Boolean)

    Whether message is enabled

  • screenIds (Array)

    ScreenIds where message is shown

Returns:

  • (Hash)

    Updated display message



56
57
58
# File 'lib/bwapi/client/command_center/displays/messages.rb', line 56

def update_message(display_id, message_id, opts = {})
  put "commandcenter/displays/#{display_id}/messages/#{message_id}", opts
end