Sha256: be01972c8b02306191b257f9e4ae813a598f02f4465c735f44e947d568d361a8

Contents?: true

Size: 332 Bytes

Versions: 1

Compression:

Stored size: 332 Bytes

Contents

require "delegate"

module Ddr
  module Auth
    # Wraps a String
    class Group < SimpleDelegator

      # The inverse of `Ddr::Auth::User#member_of?(group)`
      def has_member?(user)
        user.groups.include?(self)
      end

      def to_agent
        to_s
      end
      alias_method :agent, :to_agent

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ddr-models-1.13.2 lib/ddr/auth/group.rb