Class: Remotty::UserSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/remotty/user_serializer.rb

Overview

user serializer

column

  • id

  • name

  • email

  • use_password

  • avatar

    • original

    • small

    • thumb

  • auth_token

Direct Known Subclasses

UserSerializer

Instance Method Summary collapse

Instance Method Details

#avatarObject



17
18
19
20
21
22
23
# File 'app/serializers/remotty/user_serializer.rb', line 17

def avatar
  {
    original:object.avatar.url,
    small:object.avatar.url(:small),
    thumb:object.avatar.url(:thumb)
  }
end

#include_auth_token?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/serializers/remotty/user_serializer.rb', line 25

def include_auth_token?
  object.auth_token
end