Sha256: 61f9db0df93c5102ea47110e194ba846106992b393275360380b0dbb00db142d

Contents?: true

Size: 901 Bytes

Versions: 1

Compression:

Stored size: 901 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
      # @return []
      def remote
        Remote::Member
      end

      # @return [Symbol]
      def type
        :member
      end
    end

    # @param  [Hash]
    # @return []
    def decorator(options = {})
      Decorators::Member.new(self, options)
    end

    # @param  [Hash]
    # @return []
    def presenter(options = {})
      Presenters::Member.new(decorator, options)
    end

    # @return [FalseClass]
    def default?
      false
    end

    # @return [Symbol]
    def type
      self.class.type
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.11 lib/troo/models/member.rb