Class: Oksky::Chat::Object::UserInfosResource

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

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

#master_keyword_idObject



34
35
36
# File 'lib/oksky/chat/object/user_infos_resource.rb', line 34

def master_keyword_id
  relationships.dig("master_keyword", "data", "id")
end

#relationshipsObject



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

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

#user_idObject



30
31
32
# File 'lib/oksky/chat/object/user_infos_resource.rb', line 30

def user_id
  relationships.dig("user", "data", "id")
end

#user_infoObject



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

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

#value_dataObject



10
11
12
# File 'lib/oksky/chat/object/user_infos_resource.rb', line 10

def value_data
  content_value("value_data")
end