Sha256: 7fea8dfbf45c1176b0db47f8f84ad323c41dd99528e776c1941a66bd821232ba

Contents?: true

Size: 771 Bytes

Versions: 14

Compression:

Stored size: 771 Bytes

Contents

# -*- coding: utf-8 -*-

module DataMapper
  module Validations
    module Fixtures
      class MathematicalFunction
        #
        # Behaviors
        #

        include ::DataMapper::Resource

        #
        # Properties
        #

        property :id,    Serial
        property :input,  Float, :auto_validation => false
        property :output, Float, :auto_validation => false

        #
        # Validations
        #

        # function domain
        # don't ask me what function that is
        validates_within :input,  :set => (1..n)

        # function range
        validates_within :output, :set => (-n..0), :message => "Negative values or zero only, please"
      end # MathematicalFunction
    end # Fixtures
  end # Validations
end # DataMapper

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
ardm-validations-1.2.0 spec/fixtures/mathematical_function.rb
dm-validations-1.2.0 spec/fixtures/mathematical_function.rb
dm-validations-1.2.0.rc2 spec/fixtures/mathematical_function.rb
dm-validations-1.2.0.rc1 spec/fixtures/mathematical_function.rb
dm-validations-1.1.0 spec/fixtures/mathematical_function.rb
dm-validations-1.1.0.rc3 spec/fixtures/mathematical_function.rb
dm-validations-1.1.0.rc2 spec/fixtures/mathematical_function.rb
dm-validations-1.1.0.rc1 spec/fixtures/mathematical_function.rb
dm-validations-1.0.2 spec/fixtures/mathematical_function.rb
dm-validations-1.0.1 spec/fixtures/mathematical_function.rb
dm-validations-1.0.0 spec/fixtures/mathematical_function.rb
dm-validations-1.0.0.rc3 spec/fixtures/mathematical_function.rb
dm-validations-1.0.0.rc2 spec/fixtures/mathematical_function.rb
dm-validations-1.0.0.rc1 spec/fixtures/mathematical_function.rb