Sha256: dc597ea53426f3b75abee5b660caccabe8d02f494175052a8eba731cf5198c51

Contents?: true

Size: 680 Bytes

Versions: 9

Compression:

Stored size: 680 Bytes

Contents

module ActiveSambaLdap
  module ComputerAccountEntry
    NAME_RE = /\A#{AccountEntry::NAME_RE_SRC}\$\z/

    def self.included(base)
      super
      base.extend(ClassMethods)
      base.validates_format_of :uid, :with => NAME_RE
    end

    module ClassMethods
      def valid_name?(name)
        NAME_RE =~ name ? true : false
      end

      private
      def default_prefix
        configuration[:computers_suffix]
      end
    end

    def remove_from_group(group)
      group.computers.delete(self)
    end

    def default_gid_number
      self.class.configuration[:default_computer_gid]
    end

    def created_group_name
      super.sub(/\$$/, '')
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
activesambaldap-0.1.0 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.9 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.8 lib/active_samba_ldap/computer_account_entry.rb
ActiveSambaLdap-0.0.7 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.7 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.6 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.4 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.5 lib/active_samba_ldap/computer_account_entry.rb
activesambaldap-0.0.3 lib/active_samba_ldap/computer_account_entry.rb