Sha256: fedb046bfc977e86f2280eea4ff8374d8534bbccb53c20a6200984cc5647ae43

Contents?: true

Size: 740 Bytes

Versions: 5

Compression:

Stored size: 740 Bytes

Contents

module Ixtlan
  module Models
    class Authentication 
      include DataMapper::Resource

      def self.name
        "Authentication"
      end

      property :login, String,:format => /^[a-zA-Z0-9\-!=+$%^&*\(\){}|\[\]<>_.]*$/, :key => true
      
      property :password, String,:format => /^[a-zA-Z0-9_.]*$/
      
      attr_accessor :token
      
      belongs_to :user, :model => ::Ixtlan::Models::USER

      if protected_instance_methods.find {|m| m == 'to_x'}.nil?
       
        protected

        alias :to_x :to_xml_document
        def to_xml_document(opts, doc = nil)
          opts.merge!({:exclude => [:password,:user_id], :methods => [:token, :user]})
          to_x(opts, doc)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ixtlan-0.2.4 lib/ixtlan/models/authentication.rb
ixtlan-0.2.3 lib/ixtlan/models/authentication.rb
ixtlan-0.2.2 lib/ixtlan/models/authentication.rb
ixtlan-0.2.1 lib/ixtlan/models/authentication.rb
ixtlan-0.2.0 lib/ixtlan/models/authentication.rb