Sha256: e43412ad813738b52a59d24f9577477958c6092319eabf068748773faac230b0

Contents?: true

Size: 615 Bytes

Versions: 2

Compression:

Stored size: 615 Bytes

Contents

module MeducationSDK
  class User < Loquor::Resource
    self.path = "/users"

    def community_memberships
      CommunityMembership.where(user_id: 1)
    end

    def communities
      Community.where(id: community_memberships.map(&:id))
    end

    def settings
      UserSettings.where(user_id: id).first
    end
  end

  class UserMock < User
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      name: "Jeremy Walker",
      photo_url: "http://i.telegraph.co.uk/multimedia/archive/02351/cross-eyed-cat_2351472k.jpg",
      primary_email_address: "jez.walker@gmail.com"
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
meducation_sdk-0.4.1 lib/meducation_sdk/resources/user.rb
meducation_sdk-0.4.0 lib/meducation_sdk/resources/user.rb