Sha256: 600e3bcc5112f7ded0cf85d43c5edb34cbe6fbae18247590f95a302a63633895

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 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,
      first_name: "Jeremy",
      surname: "Walker",
      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",
      url_code: "asd1234567",
      is_site_admin: false
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
meducation_sdk-0.6.1 lib/meducation_sdk/resources/user.rb
meducation_sdk-0.6.0 lib/meducation_sdk/resources/user.rb
meducation_sdk-0.5.0 lib/meducation_sdk/resources/user.rb