Class: Oksky::Chat::Object::SupportsResource

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

#customer_idObject



48
49
50
# File 'lib/oksky/chat/object/supports_resource.rb', line 48

def customer_id
  relationships.dig("customer", "data", "id")
end

#end_time_unixString<Oksky::Chat::Event::Support>

Returns:

  • (String<Oksky::Chat::Event::Support>)


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

def end_time_unix
  content_value('end_time_unix')
end

#idObject



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

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

#latest_message_idObject



44
45
46
# File 'lib/oksky/chat/object/supports_resource.rb', line 44

def latest_message_id
  relationships.dig("latest_message", "data", "id")
end

#membersArray

Returns:

  • (Array)


53
54
55
# File 'lib/oksky/chat/object/supports_resource.rb', line 53

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

#relationshipsObject



28
29
30
31
32
33
34
# File 'lib/oksky/chat/object/supports_resource.rb', line 28

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

#room_idObject



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

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

#start_time_unixHash<Oksky::Chat::Event::Support>

Returns:

  • (Hash<Oksky::Chat::Event::Support>)


16
17
18
# File 'lib/oksky/chat/object/supports_resource.rb', line 16

def start_time_unix
  content_value("start_time_unix")
end

#supportObject



20
21
22
23
24
25
26
# File 'lib/oksky/chat/object/supports_resource.rb', line 20

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

#user_idObject



36
37
38
# File 'lib/oksky/chat/object/supports_resource.rb', line 36

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