Class: FormObj::Form::Array

Inherits:
Struct::Array show all
Defined in:
lib/form_obj/form/array.rb

Direct Known Subclasses

ModelMapper::Array

Instance Method Summary collapse

Methods inherited from Struct::Array

#build, #create, #to_hash, #update_attributes

Instance Method Details

#mark_as_persistedObject



8
9
10
# File 'lib/form_obj/form/array.rb', line 8

def mark_as_persisted
  each(&:mark_as_persisted)
end

#mark_for_destructionObject



12
13
14
# File 'lib/form_obj/form/array.rb', line 12

def mark_for_destruction
  each(&:mark_for_destruction)
end

#marked_for_destructionObject



16
17
18
# File 'lib/form_obj/form/array.rb', line 16

def marked_for_destruction
  select(&:marked_for_destruction?)
end

#persisted?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/form_obj/form/array.rb', line 4

def persisted?
  empty? || all?(&:persisted?)
end