Sha256: 33693abc3620e4b8810d445ea06bcf35a6119aa59ec1e72d65f1468ba7542baa

Contents?: true

Size: 731 Bytes

Versions: 2

Compression:

Stored size: 731 Bytes

Contents

module Troo
  class Member < Ohm::Model
    include Ohm::DataTypes
    include ModelHelpers

    attribute :username
    attribute :email
    attribute :full_name
    attribute :initials
    attribute :avatar_id
    attribute :bio
    attribute :url
    attribute :external_id
    attribute :short_id

    index :external_id
    index :short_id

    class << self
      def remote
        Remote::Member
      end

      def type
        :member
      end
    end

    def decorator(options = {})
      Decorators::Member.new(self, options)
    end

    def presenter(options = {})
      Presenters::Member.new(decorator, options)
    end

    def default?
      false
    end

    def type
      self.class.type
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troo-0.0.10 lib/troo/models/member.rb
troo-0.0.9 lib/troo/models/member.rb