Sha256: c90c06b22312dba457f075594b17d22979a01567c9037dee44653f5e11e77c27
Contents?: true
Size: 647 Bytes
Versions: 15
Compression:
Stored size: 647 Bytes
Contents
class Validez include DynaModel::Document string_attr :key string_attr :ranger string_attr :body validates_presence_of :body boolean_attr :bool_party, default_value: false validates :bool_party, inclusion: { in: [true, false] } integer_attr :inteater validates :inteater, numericality: { greater_than: 1, less_than: 4 } string_attr :superhero validate :check_superhero, if: lambda { |v| v.inteater == 3 } hash_key :key range_key :ranger read_provision 4 write_provision 4 def check_superhero unless self.superhero == "batman" self.errors.add(:superhero, 'should be batman') end end end
Version data entries
15 entries across 15 versions & 1 rubygems