Sha256: 9c94e0ed9fa5c29a5cb695579bed49bb2a102cc471834aa7ac6f178638ef86df

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

class Profile extends Backbone.Model
  model: 'profile'
  url: => "#{TentStatus.api_root}/profile"

  core_profile: =>
    @get('https://tent.io/types/info/core/v0.1.0')

  basic_profile: =>
    @get('https://tent.io/types/info/basic/v0.1.0')

  entity: =>
    @core_profile()?['entity']

  bio: =>
    @basic_profile()?['bio']

  name: =>
    @basic_profile()?['name'] || TentStatus.Helpers.formatUrl(@core_profile()?['entity'] || '')

  hasName: =>
    !!(@basic_profile()?['name'])

  avatar: =>
    @basic_profile()?['avatar_url']

TentStatus.Models.profile = new Profile

class TentStatus.Models.Profile extends Profile
  url: => "#{TentStatus.api_root}/#{@get('follow_type')}/#{@get('id')}/profile"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tent-status-0.0.1 assets/javascripts/models/profile.js.coffee