Class: Oksky::Chat::Object::MasterKeywordsResource

Inherits:
Base
  • Object
show all
Defined in:
lib/oksky/chat/object/master_keywords_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/master_keywords_resource.rb', line 6

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

#key_nameObject



18
19
20
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 18

def key_name
  content_value.dig("key_name")
end

#key_titleObject



22
23
24
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 22

def key_title
  content_value.dig("key_title")
end

#master_keywordObject



10
11
12
13
14
15
16
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 10

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

#relationshipsObject



31
32
33
34
35
36
37
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 31

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

#suggestionsArray

Returns:

  • (Array)


27
28
29
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 27

def suggestions
  content_value.dig("suggestions")
end

#user_infosArray

Returns:

  • (Array)


40
41
42
# File 'lib/oksky/chat/object/master_keywords_resource.rb', line 40

def user_infos
  relationships.dig("user_infos", "data")
end