Class: ActiveExcel::ValidatedRecords
- Inherits:
-
Object
- Object
- ActiveExcel::ValidatedRecords
- Defined in:
- lib/active_excel/validated_records.rb
Instance Method Summary collapse
- #all_records ⇒ Object
-
#initialize(table_name, records) ⇒ ValidatedRecords
constructor
A new instance of ValidatedRecords.
- #invalid_records ⇒ Object
- #valid_records ⇒ Object
Constructor Details
#initialize(table_name, records) ⇒ ValidatedRecords
Returns a new instance of ValidatedRecords.
5 6 7 8 |
# File 'lib/active_excel/validated_records.rb', line 5 def initialize(table_name, records) @table_name = table_name @records = records end |
Instance Method Details
#all_records ⇒ Object
10 11 12 |
# File 'lib/active_excel/validated_records.rb', line 10 def all_records @records end |
#invalid_records ⇒ Object
18 19 20 |
# File 'lib/active_excel/validated_records.rb', line 18 def invalid_records @records.reject(&:valid?) end |
#valid_records ⇒ Object
14 15 16 |
# File 'lib/active_excel/validated_records.rb', line 14 def valid_records @records.select(&:valid?) end |