Class: Oksky::Chat::Object::SuggestionsResource

Inherits:
Base
  • Object
show all
Defined in:
lib/oksky/chat/object/suggestions_resource.rb

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize

Constructor Details

This class inherits a constructor from Oksky::Chat::Object::Base

Instance Method Details

#idObject



6
7
8
# File 'lib/oksky/chat/object/suggestions_resource.rb', line 6

def id
  @src.dig("id")
end

#relationshipsObject



23
24
25
26
27
28
29
# File 'lib/oksky/chat/object/suggestions_resource.rb', line 23

def relationships
  if exist_relationships?
    return @src['relationships']
  else
    {}
  end
end

#room_idObject



31
32
33
# File 'lib/oksky/chat/object/suggestions_resource.rb', line 31

def room_id
  relationships.dig("room", "id")
end

#suggestionObject



15
16
17
18
19
20
21
# File 'lib/oksky/chat/object/suggestions_resource.rb', line 15

def suggestion
  if @src.has_key?('attributes')
    @src['attributes']
  else
    @src
  end
end

#suggestion_messages_dataArray

Returns:

  • (Array)


11
12
13
# File 'lib/oksky/chat/object/suggestions_resource.rb', line 11

def suggestion_messages_data
  content_value("suggestion_messages_data")
end