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 = {}) ⇒ Hashie::Mash

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:

  • (Hashie::Mash) —

    New display message



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

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

#delete_message(display_id, message_id) ⇒ Hashie::Mash

Delete an existing display message

Parameters:

  • display_id (Integer) —

    The display id

  • message_id (Integer) —

    The message id

Returns:

  • (Hashie::Mash) —

    Deleted display message



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

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

#get_message(display_id, message_id) ⇒ Hashie::Mash

Get an existing display message

Parameters:

  • display_id (Integer) —

    The display id

  • message_id (Integer) —

    The message id

Returns:

  • (Hashie::Mash) —

    Specific message for display



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

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

#messages(display_id) ⇒ Hashie::Mash

Get the messages for an existing display

Parameters:

  • display_id (Integer) —

    The display id

Returns:

  • (Hashie::Mash) —

    All messages for display



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

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

#update_message(display_id, message_id, opts = {}) ⇒ Hashie::Mash

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:

  • (Hashie::Mash) —

    Updated display message



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

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