Sha256: 8747917fd999aa580e30adfc350653e7756193b390399173940d29ed7625d567

Contents?: true

Size: 401 Bytes

Versions: 41

Compression:

Stored size: 401 Bytes

Contents

# encoding: utf-8
module Sunrise
  module Models
    class RoleType
      include EnumField::DefineEnum
      
      attr_reader :code
      
      def initialize(code)
        @code = code.to_sym
      end
      
      def title
        I18n.t(@code, :scope => [:manage, :role, :kind])
      end
      
      def self.legal?(value)
        all.map(&:id).include?(value)
      end  
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
sunrise-cms-0.3.0.rc2 lib/sunrise/models/role_type.rb