Class: Rains::Form

Inherits:
Object
  • Object
show all
Extended by:
DSL::Assertions
Defined in:
lib/rains/form.rb

Instance Method Summary collapse

Methods included from DSL::Assertions

assertions, extended

Instance Method Details

#as_formObject



6
7
8
# File 'lib/rains/form.rb', line 6

def as_form
  attributes
end

#validateObject



10
11
12
13
14
15
16
17
# File 'lib/rains/form.rb', line 10

def validate
  cached = as_form
  truthy = ::Assertion::State.new(true)

  __assertions__.inject(truthy) do |acc, assertion|
    acc + assertion[cached]
  end
end