Class: ActiveRecord::Import::ValueSetsRecordsParser
- Inherits:
-
Object
- Object
- ActiveRecord::Import::ValueSetsRecordsParser
- Defined in:
- lib/activerecord-import/value_sets_parser.rb
Instance Attribute Summary collapse
-
#max_records ⇒ Object
readonly
Returns the value of attribute max_records.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(values, options) ⇒ ValueSetsRecordsParser
constructor
A new instance of ValueSetsRecordsParser.
- #parse ⇒ Object
Constructor Details
#initialize(values, options) ⇒ ValueSetsRecordsParser
Returns a new instance of ValueSetsRecordsParser.
73 74 75 76 |
# File 'lib/activerecord-import/value_sets_parser.rb', line 73 def initialize(values, ) @values = values @max_records = [:max_records] end |
Instance Attribute Details
#max_records ⇒ Object (readonly)
Returns the value of attribute max_records.
67 68 69 |
# File 'lib/activerecord-import/value_sets_parser.rb', line 67 def max_records @max_records end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
67 68 69 |
# File 'lib/activerecord-import/value_sets_parser.rb', line 67 def values @values end |
Class Method Details
.parse(values, options) ⇒ Object
69 70 71 |
# File 'lib/activerecord-import/value_sets_parser.rb', line 69 def self.parse(values, ) new(values, ).parse end |
Instance Method Details
#parse ⇒ Object
78 79 80 |
# File 'lib/activerecord-import/value_sets_parser.rb', line 78 def parse @values.in_groups_of(max_records, false) end |