Class: Sqwiggle::Message

Inherits:
Api::Resource show all
Defined in:
lib/sqwiggle/message.rb

Instance Method Summary collapse

Methods inherited from Api::Resource

all, create, create!, #default_client, default_endpoint, #delete, find, #persisted?, #save, #save!, #update, #update!

Instance Method Details

#authorObject



15
16
17
18
19
20
21
# File 'lib/sqwiggle/message.rb', line 15

def author
  if @author[:type] == 'user'
    client.users.find(@author[:id])
  elsif @author[:type] == 'client'
    client.api_clients.find(@author[:id])
  end
end