Class: Oksky::Chat::Object::UserEventsResource

Inherits:
Base
  • Object
show all
Defined in:
lib/oksky/chat/object/user_events_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

#created_at_unixObject



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

def created_at_unix
  content_value("created_at_unix")
end

#idObject



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

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

#kindObject



14
15
16
# File 'lib/oksky/chat/object/user_events_resource.rb', line 14

def kind
  content_value("kind")
end

#relationshipsObject



34
35
36
37
38
39
40
# File 'lib/oksky/chat/object/user_events_resource.rb', line 34

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

#resource_idObject



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

def resource_id
  content_value("resource_id")
end

#resource_typeObject



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

def resource_type
  content_value("resource_type")
end

#user_eventObject



26
27
28
29
30
31
32
# File 'lib/oksky/chat/object/user_events_resource.rb', line 26

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

#user_idObject



42
43
44
# File 'lib/oksky/chat/object/user_events_resource.rb', line 42

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