Sha256: 16aeb9ff86e955dad25ca6a0bd8612633c84e6fb57cb58f79b387d70a9ab5825
Contents?: true
Size: 858 Bytes
Versions: 1
Compression:
Stored size: 858 Bytes
Contents
module CsvRowModel module Model module Base extend ActiveSupport::Concern included do attr_reader :context, :parent, :initialized_at end # @param [Hash] options # @option options [String] :parent if the instance is a child, pass the parent # @option options [Hash] :context extra data you want to work with the model def initialize(options={}) @initialized_at = DateTime.now @parent = options[:parent] @context = OpenStruct.new(options[:context] || {}) end # Safe to override. # @return [Boolean] returns true, if this instance should be skipped def skip? !valid? end # Safe to override. # @return [Boolean] returns true, if the entire csv file should stop reading def abort? false end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
csv_row_model-1.0.0.beta2 | lib/csv_row_model/concerns/model/base.rb |