Sha256: 07f79df9a8c931ba2424d53b4c2ea9869649a83715c8b1636d6ae416a66fe2e6

Contents?: true

Size: 351 Bytes

Versions: 5

Compression:

Stored size: 351 Bytes

Contents

# encoding: utf-8
module Sunrise
  module Models
    class RoleType
      def initialize(code)
        @code = code.to_sym
      end
      attr_reader :code
      
      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

5 entries across 5 versions & 1 rubygems

Version Path
sunrise-core-0.2.2 lib/sunrise/models/role_type.rb
sunrise-core-0.2.1 lib/sunrise/models/role_type.rb
sunrise-core-0.2.0 lib/sunrise/models/role_type.rb
sunrise-core-0.1.5 lib/sunrise/models/role_type.rb
sunrise-core-0.1.4 lib/sunrise/models/role_type.rb