Module: DataMapper::ActiveModel::InstanceMethods

### Home Classes Methods

### In Files

- lib/dm-active_model.rb

### Methods

- #errors
- #persisted?
- #to_key
- #to_model
- #to_param
- #valid?

### Files

- LICENSE
- README.rdoc
- TODO

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::ActiveModel
- DataMapper::ActiveModel::InstanceMethods

No matching classes.

# DataMapper::ActiveModel::InstanceMethods

### Public Instance Methods

errors() click to toggle source

    # File lib/dm-active_model.rb, line 39
    def errors
      obj = Object.new
      def obj.[](key)         [] end
      def obj.full_messages() [] end
      obj
    end

persisted?() click to toggle source

    # File lib/dm-active_model.rb, line 13
    def persisted?
      saved?
    end

to_key() click to toggle source

    # File lib/dm-active_model.rb, line 17
    def to_key
      key
    end

to_model() click to toggle source

    # File lib/dm-active_model.rb, line 9
    def to_model
      self
    end

to_param() click to toggle source

    # File lib/dm-active_model.rb, line 21
    def to_param
      return nil if key.nil?
      if key.length > 1
        raise "You need to implement #to_param yourself to support this key: #{self.class.key.inspect}"
      else
        self.key.first.to_s
      end
    end

valid?() click to toggle source

    # File lib/dm-active_model.rb, line 35
    def valid?
      true
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.