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-1.0.6 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.5 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.4 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.3 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.2 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.1 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.0 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.0.rc3 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.0.rc2 lib/sunrise/models/role_type.rb
sunrise-cms-1.0.0.rc1 lib/sunrise/models/role_type.rb
sunrise-cms-0.7.0.rc2 lib/sunrise/models/role_type.rb
sunrise-cms-0.7.0.rc1 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.11 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.10 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.9 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.8 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.7 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.6 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.5 lib/sunrise/models/role_type.rb
sunrise-cms-0.6.4 lib/sunrise/models/role_type.rb