Class: Glass::TimelineItem::MenuItems

Inherits:
Object
  • Object
show all
Defined in:
lib/glass/timeline/timeline_item.rb

Defined Under Namespace

Classes: Values

Constant Summary collapse

REPLY =
"REPLY"
REPLY_ALL =
"REPLY_ALL"
DELETE =
"DELETE"
SHARE =
"SHARE"
READ_ALOUD =
"READ_ALOUD"
VOICE_CALL =
"VOICE_CALL"
"NAVIGATE"
TOGGLE_PINNED =
"TOOGLE_PINNED"
CUSTOM =
"CUSTOM"

Instance Attribute Summary collapse

Instance Attribute Details

#actionsObject

Controls the behavior when the user picks the menu option. Allowed values are: CUSTOM - Custom action set by the service. When the user selects this menuItem, the API triggers a notification to your callbackUrl with the userActions.type set to CUSTOM and the userActions.payload set to the ID of this menu item. This is the default value. Built-in actions:

REPLY - Initiate a reply to the timeline item using the voice recording UI. The creator attribute must be set in the timeline item for this menu to be available.
REPLY_ALL - Same behavior as REPLY. The original timeline item's recipients will be added to the reply item.
DELETE - Delete the timeline item.
SHARE - Share the timeline item with the available contacts.
READ_ALOUD - Read the timeline item's speakableText aloud; if this field is not set, read the text field; if none of those fields are set, this menu item is ignored.
VOICE_CALL - Initiate a phone call using the timeline item's creator.phone_number attribute as recipient.
NAVIGATE - Navigate to the timeline item's location.
TOGGLE_PINNED - Toggle the isPinned state of the timeline item.


298
299
300
# File 'lib/glass/timeline/timeline_item.rb', line 298

def actions
  @actions
end

#idObject

The ID for this menu item. This is generated by the application and is treated as an opaque token.



282
283
284
# File 'lib/glass/timeline/timeline_item.rb', line 282

def id
  @id
end

#removeWhenSelectedObject

If set to true on a CUSTOM menu item, that item will be removed from the menu after it is selected.



308
309
310
# File 'lib/glass/timeline/timeline_item.rb', line 308

def removeWhenSelected
  @removeWhenSelected
end

#valuesObject

For CUSTOM items, a list of values controlling the appearance of the menu item in each of its states. A value for the DEFAULT state must be provided. If the PENDING or CONFIRMED states are missing, they will not be shown.



304
305
306
# File 'lib/glass/timeline/timeline_item.rb', line 304

def values
  @values
end