{: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[ o:$YARD::CodeObjects::ModuleObject;IC;[o:#YARD::CodeObjects::ClassObject;IC;[o:$YARD::CodeObjects::MethodObject:@module_functionF: @scope: class:@visibility: public: @pathI"'Csv2hash::Main.generate_definition:EF:@parameters[[I" name;T0[I" &block;T0: @files[[I"lib/csv2hash.rb;Ti&:@current_file_has_commentsF: @name:generate_definition:@source_type: ruby: @tags[:@docstrings{:@docstringIC:YARD::Docstring" ;F: @object@ : @summary0:@hash_flagF:@ref_tags[;[: @allI";T:@unresolved_reference0:@namespace@ :@signatureI")def generate_definition name, &block;T:@explicitT: @sourceI"rdef generate_definition name, &block definition = Definition.new name, &block Main[name] = definition end;T: @dynamicTo; ; F; ;;;;I"Csv2hash::Main.[];F;[[I"definition_name;T0;[[@i+;F;:[];;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@ ;%I"def [] definition_name;T;&T;'I"=def [] definition_name @@registry[definition_name] end;T;(To; ; F; ;;;;I"Csv2hash::Main.[]=;F;[[I"definition_name;T0[I" role;T0;[[@i/;F;:[]=;;;[;{;IC;" ;F;@-;0; F;![;[;"I";T;#0;$@ ;%I""def []= definition_name, role;T;&T;'I"Kdef []= definition_name, role @@registry[definition_name] = role end;T;(To:+YARD::CodeObjects::ClassVariableObject;[[@i4;F;:@@registry;;;;;[;{;IC;" ;F;@>;0; F;![;[;"I";T;#0;$@ ;I"Csv2hash::Main::@@registry;F;%I"@@registry = Registry.new;T;'I"@@registry = Registry.new;T: @valueI"Registry.new;T;(To; ; F; : instance;;;I"Csv2hash::Main#definition;F;[;[[@i6;F;:definition;;;[;{;IC;".Returns the value of attribute definition ;T;@K;0; F;![;[;"I".Returns the value of attribute definition;T;#0;$@ ;%I"def definition;T;'I"%def definition @definition end;T;(To; ; F; ;.;;;I"Csv2hash::Main#definition=;F;[[I" value;T0;[[@i6;F;:definition=;;;[;{;IC;"]Sets the attribute definition @param value the value to set the attribute definition to. ;T;@X;0; F;![;[;"I"]Sets the attribute definition @param value the value to set the attribute definition to.;T;#0;$@ ;%I"def definition=(value);T;'I"5def definition=(value) @definition = value end;T;(To; ; F; ;.;;;I"%Csv2hash::Main#file_path_or_data;F;[;[[@i6;F;:file_path_or_data;;;[;{;IC;"5Returns the value of attribute file_path_or_data ;T;@g;0; F;![;[;"I"5Returns the value of attribute file_path_or_data;T;#0;$@ ;%I"def file_path_or_data;T;'I"3def file_path_or_data @file_path_or_data end;T;(To; ; F; ;.;;;I"&Csv2hash::Main#file_path_or_data=;F;[[I" value;T0;[[@i6;F;:file_path_or_data=;;;[;{;IC;"kSets the attribute file_path_or_data @param value the value to set the attribute file_path_or_data to. ;T;@t;0; F;![;[;"I"kSets the attribute file_path_or_data @param value the value to set the attribute file_path_or_data to.;T;#0;$@ ;%I""def file_path_or_data=(value);T;'I"Cdef file_path_or_data=(value) @file_path_or_data = value end;T;(To; ; F; ;.;;;I"Csv2hash::Main#data;F;[;[[@i6;F;: data;;;[;{;IC;"(Returns the value of attribute data ;T;@~;0; F;![;[;"I"(Returns the value of attribute data;T;#0;$@ ;%I" def data;T;'I"def data @data end;T;(To; ; F; ;.;;;I"Csv2hash::Main#data=;F;[[I" value;T0;[[@i6;F;: data=;;;[;{;IC;"QSets the attribute data @param value the value to set the attribute data to. ;T;@;0; F;![;[;"I"QSets the attribute data @param value the value to set the attribute data to.;T;#0;$@ ;%I"def data=(value);T;'I")def data=(value) @data = value end;T;(To; ; F; ;.;;;I"Csv2hash::Main#notifier;F;[;[[@i6;F;: notifier;;;[;{;IC;",Returns the value of attribute notifier ;T;@;0; F;![;[;"I",Returns the value of attribute notifier;T;#0;$@ ;%I"def notifier;T;'I"!def notifier @notifier end;T;(To; ; F; ;.;;;I"Csv2hash::Main#notifier=;F;[[I" value;T0;[[@i6;F;:notifier=;;;[;{;IC;"YSets the attribute notifier @param value the value to set the attribute notifier to. ;T;@;0; F;![;[;"I"YSets the attribute notifier @param value the value to set the attribute notifier to.;T;#0;$@ ;%I"def notifier=(value);T;'I"1def notifier=(value) @notifier = value end;T;(To; ; F; ;.;;;I"$Csv2hash::Main#break_on_failure;F;[;[[@i6;F;:break_on_failure;;;[;{;IC;"4Returns the value of attribute break_on_failure ;T;@;0; F;![;[;"I"4Returns the value of attribute break_on_failure;T;#0;$@ ;%I"def break_on_failure;T;'I"1def break_on_failure @break_on_failure end;T;(To; ; F; ;.;;;I"%Csv2hash::Main#break_on_failure=;F;[[I" value;T0;[[@i6;F;:break_on_failure=;;;[;{;IC;"iSets the attribute break_on_failure @param value the value to set the attribute break_on_failure to. ;T;@;0; F;![;[;"I"iSets the attribute break_on_failure @param value the value to set the attribute break_on_failure to.;T;#0;$@ ;%I"!def break_on_failure=(value);T;'I"Adef break_on_failure=(value) @break_on_failure = value end;T;(To; ; F; ;.;;;I"Csv2hash::Main#errors;F;[;[[@i6;F;: errors;;;[;{;IC;"*Returns the value of attribute errors ;T;@;0; F;![;[;"I"*Returns the value of attribute errors;T;#0;$@ ;%I"def errors;T;'I"def errors @errors end;T;(To; ; F; ;.;;;I"Csv2hash::Main#errors=;F;[[I" value;T0;[[@i6;F;: errors=;;;[;{;IC;"USets the attribute errors @param value the value to set the attribute errors to. ;T;@;0; F;![;[;"I"USets the attribute errors @param value the value to set the attribute errors to.;T;#0;$@ ;%I"def errors=(value);T;'I"-def errors=(value) @errors = value end;T;(To; ; F; ;.;;;I"Csv2hash::Main#options;F;[;[[@i6;F;: options;;;[;{;IC;"+Returns the value of attribute options ;T;@;0; F;![;[;"I"+Returns the value of attribute options;T;#0;$@ ;%I"def options;T;'I"def options @options end;T;(To; ; F; ;.;;;I"Csv2hash::Main#options=;F;[[I" value;T0;[[@i6;F;: options=;;;[;{;IC;"WSets the attribute options @param value the value to set the attribute options to. ;T;@;0; F;![;[;"I"WSets the attribute options @param value the value to set the attribute options to.;T;#0;$@ ;%I"def options=(value);T;'I"/def options=(value) @options = value end;T;(To; ; F; ;.;;;I"Csv2hash::Main#initialize;F;[[I"definition;T0[I"file_path_or_data;T0[I" *args;T0;[[@i8;F;:initialize;;;[;{;IC;" ;F;@ ;0; F;![;[o:YARD::Tags::Tag :@tag_nameI" return;F: @textI"a new instance of Main;T;0: @types[I" Main;F;@ ;"I";T;#0;$@ ;%I"8def initialize definition, file_path_or_data, *args;T;&T;'I"hdef initialize definition, file_path_or_data, *args self.options = args.extract_options! self.definition, self.file_path_or_data = definition, file_path_or_data self.break_on_failure, self.errors = false, [] self.notifier = Notifier.new dynamic_lib_loading 'Parser' dynamic_lib_loading 'Validator' @data_source = data_source init_plugins end;T;(To; ; F; ;.;;;I" Csv2hash::Main#init_plugins;F;[;[[@iF;F;:init_plugins;;;[;{;IC;" ;F;@";0; F;![;[;"I";T;#0;$@ ;%I"def init_plugins;T;&T;'I"def init_plugins begin @plugins = [] ::Csv2hash::Plugins.constants.each do |name| @plugins << ::Csv2hash::Plugins.const_get(name).new(self) end rescue; end end;T;(To; ; F; ;.;;;I"Csv2hash::Main#parse!;F;[;[[@iO;F;: parse!;;;[;{;IC;" ;F;@/;0; F;![;[;"I";T;#0;$@ ;%I"def parse!;T;&T;'I"adef parse! self.break_on_failure = true parse ensure self.break_on_failure = false end;T;(To; ; F; ;.;;;I"Csv2hash::Main#parse;F;[;[[@iV;F;: parse;;;[;{;IC;" ;F;@<;0; F;![;[;"I";T;#0;$@ ;%I"def parse;T;&T;'I"[def parse load_data_source definition.validate! definition.default! validate_structure! validate_data! Csv2hash::DataWrapper.new.tap do |response| if valid? fill! response.data = data[:data] else response.valid = false response.errors = csv_with_errors notifier.notify response end end end;T;(To; ; F; ;.;;;I"#Csv2hash::Main#csv_with_errors;F;[;[[@ij;F;:csv_with_errors;;;[;{;IC;" ;F;@I;0; F;![;[;"I";T;#0;$@ ;%I"def csv_with_errors;T;&T;'I"def csv_with_errors @csv_with_errors ||= begin CsvArray.new.tap do |rows| errors.each do |error| rows << error.merge({ value: (data_source[error[:y]][error[:x]] rescue nil) }) end end #.to_csv end end;T;(To; ; F; ;.;;;I"Csv2hash::Main#data_source;F;[;[[@iv;T;:data_source;;;[;{;IC;"protected ;T;![;[;"I"protected;T;#0;@V; F:@line_rangeo: Range: exclF: beginit:endit;$@ ;%I"def data_source;T;&T;'I"def data_source @data_source ||= begin adapter_name = self.file_path_or_data.is_a?(String) ? :csv : :memory adapter = Adapter::Base.create(adapter_name, self.file_path_or_data) adapter.source end end;T;(To; ; F; ;.;;;I"$Csv2hash::Main#load_data_source;F;[;[[@i};F;:load_data_source;;;[;{;IC;"protected;T;@d;0; F;![;[;"I"protected ;T;#0;G0;$@ ;%@b;'I"def data_source @data_source ||= begin adapter_name = self.file_path_or_data.is_a?(String) ? :csv : :memory adapter = Adapter::Base.create(adapter_name, self.file_path_or_data) adapter.source end end;T;(To; ; F; ;.;: private;I"'Csv2hash::Main#dynamic_lib_loading;F;[[I" type;T0;[[@i|;F;:dynamic_lib_loading;;;[;{;IC;" ;F;@p;0; F;![;[;"I";T;#0;$@ ;%I"!def dynamic_lib_loading type;T;&T;'I"def dynamic_lib_loading type case definition.type when Csv2hash::Definition::MAPPING self.extend Module.module_eval("Csv2hash::#{type}::Mapping") when Csv2hash::Definition::COLLECTION self.extend Module.module_eval("Csv2hash::#{type}::Collection") end end;T;(T: @owner@ :@class_mixinsIC;[;O@ :@instance_mixinsIC;[o:YARD::CodeObjects::Proxy : @imethod0:@orignameI"!Csv2hash::StructureValidator;T:@orignamespace@ ;:StructureValidator;$@: @objo; ;IC;[o; ;IC;[;O@;PIC;[;O@;QIC;[;O@:@attributesIC:SymbolHash{;IC;Y{:@symbolize_valueT;.IC;Y{;ZT;ZT: @aliases{: @groups[;[[I"(lib/csv2hash/structure_validator.rb;Ti;F;:ValidationError;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"2Csv2hash::StructureValidator::ValidationError;F:@superclasso;R ;S0;T0;U0;:StandardError;$@;W0: @type;;(To:&YARD::CodeObjects::ConstantObject;[[@i;F;:MAX_COLUMN;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"-Csv2hash::StructureValidator::MAX_COLUMN;F;%I"&MAX_COLUMN = 'max_columns'.freeze;T;'I"&MAX_COLUMN = 'max_columns'.freeze;T;-I"'max_columns'.freeze;T;(To;a;[[@i;F;:MIN_COLUMN;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"-Csv2hash::StructureValidator::MIN_COLUMN;F;%I"&MIN_COLUMN = 'min_columns'.freeze;T;'I"&MIN_COLUMN = 'min_columns'.freeze;T;-I"'min_columns'.freeze;T;(To;a;[[@i;F;:RULES_NAME;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"-Csv2hash::StructureValidator::RULES_NAME;F;%I",RULES_NAME = [ MIN_COLUMN, MAX_COLUMN ];T;'I",RULES_NAME = [ MIN_COLUMN, MAX_COLUMN ];T;-I"[ MIN_COLUMN, MAX_COLUMN ];T;(To; ; F; ;.;;;I"5Csv2hash::StructureValidator#validate_structure!;F;[;[[@i;F;:validate_structure!;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def validate_structure!;T;&T;'I"def validate_structure! definition.structure_rules.each do |rule, options| begin rule_instance(rule, options).validate! data_source rescue => e self.errors << { y: nil, x: nil, message: e.message, key: nil } raise if break_on_failure end end end;T;(To; ; F; ;.;;;I"/Csv2hash::StructureValidator#rule_instance;F;[[I" rule;T0[I" options;T0;[[@i;F;:rule_instance;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"$def rule_instance rule, options;T;&T;'I"def rule_instance rule, options _rule = check_params rule begin StructureValidator.const_get(_rule.camelize).new(options) rescue NameError => e raise "Structure rule #{rule} unknow, please use one of these #{RULES_NAME}" end end;T;(To; ;IC;[o; ; F; ;.;;;I"6Csv2hash::StructureValidator::Validator#validate!;F;[[I" source;T0;[[@i);F;:validate!;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def validate! source;T;&T;'I"def validate! source source.index { |line| validate_line line }.tap do |line| raise ValidationError, error_message(line) unless line.nil? end true end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i(;F;:Validator;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I",Csv2hash::StructureValidator::Validator;F;(To; ;IC;[o; ; F; ;.;;;I"8Csv2hash::StructureValidator::MaxColumns#initialize;F;[[I" max_size;T0;[[I"4lib/csv2hash/structure_validator/max_columns.rb;Ti ;F;;=;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" return;F;@I"!a new instance of MaxColumns;T;0;A[I"MaxColumns;F;@;"I";T;#0;$@;%I"def initialize max_size;T;&T;'I"7def initialize max_size @max_size = max_size end;T;(To; ; F; ;.;;;I";Csv2hash::StructureValidator::MaxColumns#validate_line;F;[[I" line;T0;[[@i;F;:validate_line;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def validate_line line;T;&T;'I"7def validate_line line line.size > @max_size end;T;(To; ; F; ;.;;;I";Csv2hash::StructureValidator::MaxColumns#error_message;F;[[I" line;T0;[[@i;F;:error_message;;;[;{;IC;" ;F;@%;0; F;![;[;"I";T;#0;$@;%I"def error_message line;T;&T;'I"Xdef error_message line "Too many columns (max. #{@max_size}) on line #{line}" end;T;(T;O@;PIC;[;O@;QIC;[o;R ;S0;T0;U0;;h;$@;W@;`: module;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;:MaxColumns;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"-Csv2hash::StructureValidator::MaxColumns;F;^o;R ;S0;T0;U0;: Object;$@;W0;`;;(To; ;IC;[o; ; F; ;.;;;I"8Csv2hash::StructureValidator::MinColumns#initialize;F;[[I" min_size;T0;[[I"4lib/csv2hash/structure_validator/min_columns.rb;Ti ;F;;=;;;[;{;IC;" ;F;@H;0; F;![;[o;> ;?I" return;F;@I"!a new instance of MinColumns;T;0;A[I"MinColumns;F;@H;"I";T;#0;$@F;%I"def initialize min_size;T;&T;'I"7def initialize min_size @min_size = min_size end;T;(To; ; F; ;.;;;I";Csv2hash::StructureValidator::MinColumns#validate_line;F;[[I" line;T0;[[@Oi;F;;i;;;[;{;IC;" ;F;@];0; F;![;[;"I";T;#0;$@F;%I"def validate_line line;T;&T;'I"7def validate_line line line.size < @min_size end;T;(To; ; F; ;.;;;I";Csv2hash::StructureValidator::MinColumns#error_message;F;[[I" line;T0;[[@Oi;F;;j;;;[;{;IC;" ;F;@l;0; F;![;[;"I";T;#0;$@F;%I"def error_message line;T;&T;'I"Zdef error_message line "Not enough columns (min. #{@min_size}) on line #{line}" end;T;(T;O@F;PIC;[;O@F;QIC;[o;R ;S0;T0;U0;;h;$@;W@;`;k;O@F;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@Oi;F;:MinColumns;;;;;[;{;IC;" ;F;@F;0; F;![;[;"I";T;#0;$@;I"-Csv2hash::StructureValidator::MinColumns;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[ o;a;[[I"4lib/csv2hash/structure_validator/deprecation.rb;Ti ;F;:OLD_MAX_COLUMN;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I">Csv2hash::StructureValidator::Deprecation::OLD_MAX_COLUMN;F;%I")OLD_MAX_COLUMN = 'MaxColumns'.freeze;T;'I")OLD_MAX_COLUMN = 'MaxColumns'.freeze;T;-I"'MaxColumns'.freeze;T;(To;a;[[@i ;F;:OLD_MIN_COLUMN;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I">Csv2hash::StructureValidator::Deprecation::OLD_MIN_COLUMN;F;%I")OLD_MIN_COLUMN = 'MinColumns'.freeze;T;'I")OLD_MIN_COLUMN = 'MinColumns'.freeze;T;-I"'MinColumns'.freeze;T;(To;a;[[@i ;F;:OLD_RULES_NAME;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I">Csv2hash::StructureValidator::Deprecation::OLD_RULES_NAME;F;%I"8OLD_RULES_NAME = [ OLD_MIN_COLUMN, OLD_MAX_COLUMN ];T;'I"8OLD_RULES_NAME = [ OLD_MIN_COLUMN, OLD_MAX_COLUMN ];T;-I"'[ OLD_MIN_COLUMN, OLD_MAX_COLUMN ];T;(To;a;[[@i ;F;:NEW_SYNTAX;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I":Csv2hash::StructureValidator::Deprecation::NEW_SYNTAX;F;%I"VNEW_SYNTAX = { OLD_MIN_COLUMN => 'min_columns', OLD_MAX_COLUMN => 'max_columns' };T;'I"VNEW_SYNTAX = { OLD_MIN_COLUMN => 'min_columns', OLD_MAX_COLUMN => 'max_columns' };T;-I"I{ OLD_MIN_COLUMN => 'min_columns', OLD_MAX_COLUMN => 'max_columns' };T;(To; ; F; ;.;;;I";Csv2hash::StructureValidator::Deprecation#check_params;F;[[I" rule;T0;[[@i;F;:check_params;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def check_params rule;T;&T;'I"def check_params rule if OLD_RULES_NAME.include? rule warn "[DEPRECATION]: `#{rule}` is deprecated. Please use `#{NEW_SYNTAX[rule]}` instead." NEW_SYNTAX[rule] else rule.to_s end end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;:Deprecation;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I".Csv2hash::StructureValidator::Deprecation;F;(T;O@;PIC;[;O@;QIC;[o;R ;S0;T0;U0;;t;$@;W@;`;k;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[ [@i [@i[@Oi[@i;F;;V;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"!Csv2hash::StructureValidator;F;(T;`;k;O@ ;XIC;Y{;IC;Y{;ZT;.IC;Y{ ;/IC;Y{: read@K: write@X;ZT;1IC;Y{;u@g;v@t;ZT;3IC;Y{;u@~;v@;ZT;5IC;Y{;u@;v@;ZT;7IC;Y{;u@;v@;ZT;9IC;Y{;u@;v@;ZT;;IC;Y{;u@;v@;ZT;ZT;ZT;[{@d;F;\[;[[@i!;F;: Main;;;;;[;{;IC;" ;F;@ ;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Main;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[o; ;IC;[o; ; F; ;.;;;I"$Csv2hash::Parser::Mapping#fill!;F;[;[[I"#lib/csv2hash/parser/mapping.rb;Ti ;F;: fill!;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def fill!;T;&T;'I"def fill! self.data = {}.tap do |data_computed| data_computed[:data] ||= [] data_computed[:data] << {}.tap do |data_parsed| fill_it data_parsed, data_source end end end;T;(To; ; F; ;.;;;I"&Csv2hash::Parser::Mapping#fill_it;F;[[I"parsed_data;T0[I"source_data;T0;[[@i;F;: fill_it;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I")def fill_it parsed_data, source_data;T;&T;'I"def fill_it parsed_data, source_data definition.cells.each do |cell| if cell.rules.fetch :mappable y, x = cell.rules.fetch :position if (nested = cell.rules.fetch :nested) parsed_data[nested] ||= {} parsed_data[nested][cell.rules.fetch(:key)] = source_data[y][x] else parsed_data[cell.rules.fetch(:key)] = source_data[y][x] end end end end;T;(T;O@;PIC;[;O@;QIC;[o;R ;S0;T0;U0;: Parser;$@;W@ ;`;k;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: Mapping;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@ ;I"Csv2hash::Parser::Mapping;F;(To; ;IC;[o; ; F; ;.;;;I"'Csv2hash::Parser::Collection#fill!;F;[;[[I"&lib/csv2hash/parser/collection.rb;Ti;F;;x;;;[;{;IC;" ;F;@C;0; F;![;[;"I";T;#0;$@A;%I"def fill!;T;&T;'I"def fill! self.data = {}.tap do |data_computed| data_computed[:data] ||= [] self.data_source.each_with_index do |line, y| next if unexpected_line?(line, y) data_computed[:data] << {}.tap do |data_parsed| fill_it data_parsed, line end end end end;T;(To; ; F; ;.;;;I")Csv2hash::Parser::Collection#fill_it;F;[[I"parsed_data;T0[I"source_data;T0;[[@Hi;F;;y;;;[;{;IC;" ;F;@Q;0; F;![;[;"I";T;#0;$@A;%I")def fill_it parsed_data, source_data;T;&T;'I"def fill_it parsed_data, source_data definition.cells.each do |cell| if cell.rules.fetch :mappable x = cell.rules.fetch :position if (nested = cell.rules.fetch :nested) parsed_data[nested] ||= {} parsed_data[nested][cell.rules.fetch(:key)] = source_data[x] else parsed_data[cell.rules.fetch(:key)] = source_data[x] end end end end;T;(T;O@A;PIC;[;O@A;QIC;[o;R ;S0;T0;U0;:Expectation;$@;Wo; ;IC;[o; ; F; ;.;;;I"+Csv2hash::Expectation#unexpected_line?;F;[[I" line;T0[I"y;T0;[[I" lib/csv2hash/expectation.rb;Ti ;F;:unexpected_line?;;;[;{;IC;" ;F;@g;0; F;![;[o;> ;?I" return;F;@I";T;0;A[I" Boolean;T;@g;"I";T;#0;$@e;%I"!def unexpected_line? line, y;T;&T;'I"def unexpected_line? line, y return true if y < definition.header_size return true if self.options.fetch(:ignore_blank_line){false} and line.compact.empty? end;T;(T;O@e;PIC;[;O@e;QIC;[;O@e;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@pi;F;;|;;;;;[;{;IC;" ;F;@e;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Expectation;F;(T;`;ko;R ;S0;T0;U0;;z;$@;W@ ;`;k;O@A;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@Hi ;F;:Collection;;;;;[;{;IC;" ;F;@A;0; F;![;[;"I";T;#0;$@ ;I"!Csv2hash::Parser::Collection;F;(T;O@ ;PIC;[;O@ ;QIC;[;O@ ;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[I"lib/csv2hash/parser.rb;Ti[@i[@Hi ;F;;z;;;;;[;{;IC;" ;F;@ ;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Parser;F;(To;a;[[I"lib/csv2hash/version.rb;Ti;F;: VERSION;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::VERSION;F;%I"VERSION = '0.6.2';T;'I"VERSION = '0.6.2';T;-I" '0.6.2';T;(To; ;IC;[o; ; F; ;.;;;I"'Csv2hash::Discover#find_positions!;F;[;[[I"lib/csv2hash/discover.rb;Ti ;F;:find_positions!;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def find_positions!;T;&T;'I"def find_positions! definition.cells.each do |cell| y, x = cell.rules.fetch :position if y.is_a?(Array) column, matcher = y y = data_source.index { |entries| entries[column] =~ matcher } cell.rules[:position] = [y, x] end end end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: Discover;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Discover;F;(To; ;IC;[o; ; F; ;.;;;I"Csv2hash::Notifier#notify;F;[[I" response;T0;[[I"lib/csv2hash/notifier.rb;Ti;F;: notify;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def notify response;T;&T;'I"7def notify response # puts 'Csv with errors' end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: Notifier;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Notifier;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[ o; ; F; ;.;;;I"'Csv2hash::Validator#validate_rules;F;[[I"y;TI"nil;T;[[I"lib/csv2hash/validator.rb;Ti ;F;:validate_rules;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def validate_rules y=nil;T;&T;'I"Jdef validate_rules y=nil find_positions! definition.cells.each do |cell| _y, x = position cell.rules.fetch(:position) begin validate_cell (_y||y), x, cell rescue => e self.errors << { y: (_y||y), x: x, message: e.message, key: cell.rules.fetch(:key) } raise if break_on_failure end end end;T;(To; ; F; ;.;;;I"Csv2hash::Validator#valid?;F;[;[[@ i;F;: valid?;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" return;F;@I";T;0;A[I" Boolean;T;@;"I";T;#0;$@;%I")def valid?() self.errors.empty?; end;T;&T;'I")def valid?() self.errors.empty?; end;T;(To; ; F; ;.;:protected;I"&Csv2hash::Validator#validate_cell;F;[[I"y;T0[I"x;T0[I" cell;T0;[[@ i;F;:validate_cell;;;[;{;IC;" ;F;@&;0; F;![;[;"I";T;#0;$@;%I"!def validate_cell y, x, cell;T;&T;'I"Ndef validate_cell y, x, cell value = data_source[y][x] rescue nil begin raise unless value unless cell.rules.fetch :allow_blank if (extra_validator = cell.rules.fetch :extra_validator) && extra_validator.kind_of?(ExtraValidator) raise unless extra_validator.valid? cell.rules, value else if value && (values = cell.rules.fetch :values) if values.class == Range raise unless values.include?(value.to_f) else raise unless values.include?(value) end end end rescue => e raise message(cell, y, x) end end;T;(To; ; F; ;.;;;I" Csv2hash::Validator#message;F;[[I" cell;T0[I"y;T0[I"x;T0;[[@ i2;F;: message;;;[;{;IC;" ;F;@9;0; F;![;[;"I";T;#0;$@;%I"def message cell, y, x;T;&T;'I"def message cell, y, x msg = cell.rules.fetch(:message).tap do |msg| cell.rules.each { |key, value| msg.gsub!(":#{key.to_s}", value.to_s) unless key == :position } end msg.gsub ':position', "[#{y}, #{x}]" end;T;(To; ;IC;[o; ; F; ;.;;;I"0Csv2hash::Validator::Mapping#validate_data!;F;[;[[I"&lib/csv2hash/validator/mapping.rb;Ti ;F;:validate_data!;;;[;{;IC;" ;F;@N;0; F;![;[;"I";T;#0;$@L;%I"def validate_data!;T;&T;'I"8def validate_data! validate_rules data_source end;T;(To; ; F; ;.;;;I"*Csv2hash::Validator::Mapping#position;F;[[I"_position;T0;[[@Si;F;: position;;;[;{;IC;" ;F;@\;0; F;![;[;"I";T;#0;$@L;%I"def position _position;T;&T;'I"+def position _position _position end;T;(T;O@L;PIC;[;O@L;QIC;[o;R ;S0;T0;U0;;h;$@;W@;`;k;O@L;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@Si;F;;{;;;;;[;{;IC;" ;F;@L;0; F;![;[;"I";T;#0;$@;I"!Csv2hash::Validator::Mapping;F;(To; ;IC;[o; ; F; ;.;;;I"3Csv2hash::Validator::Collection#validate_data!;F;[;[[I")lib/csv2hash/validator/collection.rb;Ti;F;;;;;[;{;IC;" ;F;@~;0; F;![;[;"I";T;#0;$@|;%I"def validate_data!;T;&T;'I"def validate_data! self.data_source.each_with_index do |line, y| next if unexpected_line?(line, y) validate_rules y end end;T;(To; ; F; ;.;;;I"-Csv2hash::Validator::Collection#position;F;[[I"_position;T0;[[@i;F;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@|;%I"def position _position;T;&T;'I"2def position _position [nil, _position] end;T;(T;O@|;PIC;[;O@|;QIC;[o;R ;S0;T0;U0;;|;$@;W@e;`;ko;R ;S0;T0;U0;;h;$@;W@;`;k;O@|;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i ;F;;~;;;;;[;{;IC;" ;F;@|;0; F;![;[;"I";T;#0;$@;I"$Csv2hash::Validator::Collection;F;(T;O@;PIC;[;O@;QIC;[o;R ;S0;T0;U0;;|;$@;W@;`;k;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@ i [@Si[@i ;F;;h;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Validator;F;(To; ;IC;[o;a;[[I"lib/csv2hash/definition.rb;Ti ;F;: MAPPING;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I""Csv2hash::Definition::MAPPING;F;%I"MAPPING = 'mapping'.freeze;T;'I"MAPPING = 'mapping'.freeze;T;-I"'mapping'.freeze;T;(To;a;[[@i ;F;:COLLECTION;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"%Csv2hash::Definition::COLLECTION;F;%I"%COLLECTION = 'collection'.freeze;T;'I"%COLLECTION = 'collection'.freeze;T;-I"'collection'.freeze;T;(To;a;[[@i ;F;: TYPES;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I" Csv2hash::Definition::TYPES;F;%I"$TYPES = [ MAPPING, COLLECTION ];T;'I"$TYPES = [ MAPPING, COLLECTION ];T;-I"[ MAPPING, COLLECTION ];T;(To; ; F; ;.;;;I"Csv2hash::Definition#cells;F;[;[[@i;F;: cells;;;[;{;IC;")Returns the value of attribute cells ;T;@;0; F;![;[;"I")Returns the value of attribute cells;T;#0;$@;%I"def cells;T;'I"def cells @cells end;T;(To; ; F; ;.;;;I" Csv2hash::Definition#cells=;F;[[I" value;T0;[[@i;F;: cells=;;;[;{;IC;"SSets the attribute cells @param value the value to set the attribute cells to. ;T;@;0; F;![;[;"I"SSets the attribute cells @param value the value to set the attribute cells to.;T;#0;$@;%I"def cells=(value);T;'I"+def cells=(value) @cells = value end;T;(To; ; F; ;.;;;I")Csv2hash::Definition#structure_rules;F;[;[[@i;F;:structure_rules;;;[;{;IC;"3Returns the value of attribute structure_rules ;T;@;0; F;![;[;"I"3Returns the value of attribute structure_rules;T;#0;$@;%I"def structure_rules;T;'I"/def structure_rules @structure_rules end;T;(To; ; F; ;.;;;I"*Csv2hash::Definition#structure_rules=;F;[[I" value;T0;[[@i;F;:structure_rules=;;;[;{;IC;"gSets the attribute structure_rules @param value the value to set the attribute structure_rules to. ;T;@;0; F;![;[;"I"gSets the attribute structure_rules @param value the value to set the attribute structure_rules to.;T;#0;$@;%I" def structure_rules=(value);T;'I"?def structure_rules=(value) @structure_rules = value end;T;(To; ; F; ;.;;;I"%Csv2hash::Definition#header_size;F;[;[[@i;F;:header_size;;;[;{;IC;"/Returns the value of attribute header_size ;T;@";0; F;![;[;"I"/Returns the value of attribute header_size;T;#0;$@;%I"def header_size;T;'I"'def header_size @header_size end;T;(To; ; F; ;.;;;I"&Csv2hash::Definition#header_size=;F;[[I" value;T0;[[@i;F;:header_size=;;;[;{;IC;"_Sets the attribute header_size @param value the value to set the attribute header_size to. ;T;@/;0; F;![;[;"I"_Sets the attribute header_size @param value the value to set the attribute header_size to.;T;#0;$@;%I"def header_size=(value);T;'I"7def header_size=(value) @header_size = value end;T;(To; ; F; ;.;;;I"Csv2hash::Definition#type;F;[;[[@i;F;: type;;;[;{;IC;"(Returns the value of attribute type ;T;@>;0; F;![;[;"I"(Returns the value of attribute type;T;#0;$@;%I" def type;T;'I"def type @type end;T;(To; ; F; ;.;;;I"Csv2hash::Definition#name;F;[;[[@i;F;: name;;;[;{;IC;"(Returns the value of attribute name ;T;@K;0; F;![;[;"I"(Returns the value of attribute name;T;#0;$@;%I" def name;T;'I"def name @name end;T;(To; ; F; ;.;;;I"$Csv2hash::Definition#initialize;F;[[I" name;T0[I" &blk;T0;[[@i;F;;=;;;[;{;IC;" ;F;@X;0; F;![;[o;> ;?I" return;F;@I"!a new instance of Definition;T;0;A[I"Definition;F;@X;"I";T;#0;$@;%I"def initialize name, &blk;T;&T;'I"def initialize name, &blk @name = name self.cells = [] self.header_size = 0 self.structure_rules = {} instance_eval(&blk) if block_given? end;T;(To; ; F; ;.;;;I"!Csv2hash::Definition#mapping;F;[[I" &blk;T0;[[@i;F;: mapping;;;[;{;IC;" ;F;@n;0; F;![;[;"I";T;#0;$@;%I"def mapping &blk;T;&T;'I"?def mapping &blk instance_eval(&blk) if block_given? end;T;(To; ; F; ;.;;;I"Csv2hash::Definition#cell;F;[[I" *args;T0;[[@i;F;: cell;;;[;{;IC;" ;F;@};0; F;![;[;"I";T;#0;$@;%I"def cell *args;T;&T;'I"7def cell *args self.cells << Cell.new(*args) end;T;(To; ; F; ;.;;;I")Csv2hash::Definition#set_header_size;F;[[I" &blk;T0;[[@i!;F;:set_header_size;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def set_header_size &blk;T;&T;'I"Ldef set_header_size &blk self.header_size = yield if block_given? end;T;(To; ; F; ;.;;;I""Csv2hash::Definition#set_type;F;[[I" &blk;T0;[[@i%;F;: set_type;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def set_type &blk;T;&T;'I":def set_type &blk @type = yield if block_given? end;T;(To; ; F; ;.;;;I"-Csv2hash::Definition#set_structure_rules;F;[[I" &blk;T0;[[@i);F;:set_structure_rules;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"!def set_structure_rules &blk;T;&T;'I"Tdef set_structure_rules &blk self.structure_rules = yield if block_given? end;T;(To; ; F; ;.;;;I"#Csv2hash::Definition#validate!;F;[;[[@i-;F;;g;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def validate!;T;&T;'I"&def validate! unless TYPES.include?(@type) raise "not suitable type, please use '#{MAPPING}' or '#{COLLECTION}'" end raise 'cells must be an Array of cell' unless self.cells.class == Array raise 'structure rules must be a Hash of rules' unless self.structure_rules.class == Hash end;T;(To; ; F; ;.;;;I""Csv2hash::Definition#default!;F;[;[[@i5;F;: default!;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def default!;T;&T;'I"Hdef default! cells.each do |cell| cell.rules.fetch(:position) default_position cell unless cell.rules.has_key? :message if cell.rules.has_key? :values cell.rules.merge! message: ':key not supported, please use one of :values' else cell.rules.merge! message: 'undefined :key on :position' end end cell.rules.merge! mappable: true unless cell.rules.has_key? :mappable cell.rules.merge! type: 'string' unless cell.rules.has_key? :type cell.rules.merge! values: nil unless cell.rules.has_key? :values cell.rules.merge! nested: nil unless cell.rules.has_key? :nested cell.rules.merge! allow_blank: false unless cell.rules.has_key? :allow_blank cell.rules.merge! extra_validator: nil unless cell.rules.has_key? :extra_validator end end;T;(To; ; F; ;.;;M;I"*Csv2hash::Definition#default_position;F;[[I" cell;T0;[[@iL;F;:default_position;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def default_position cell;T;&T;'I"Qdef default_position cell case type when MAPPING y, x = cell.rules.fetch(:position, ['undefined', 'undefined']) cell.rules.merge! key: "key_#{y}_#{x}" unless cell.rules.has_key? :key when COLLECTION x = cell.rules.fetch :position cell.rules.merge! key: "key_undefined_#{x}" unless cell.rules.has_key? :key end end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{ ;IC;Y{;u@;v@;ZT;IC;Y{;u@;v@;ZT;IC;Y{;u@";v@/;ZT;IC;Y{;u@>;v0;ZT;IC;Y{;u@K;v0;ZT;ZT;ZT;[{;\[;[[@i;F;:Definition;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Definition;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(T@eo; ;IC;[ o; ; F; ;.;;;I"Csv2hash::DataWrapper#data;F;[;[[I"!lib/csv2hash/data_wrapper.rb;Ti ;F;;3;;;[;{;IC;"(Returns the value of attribute data ;T;@;0; F;![;[;"I"(Returns the value of attribute data;T;#0;$@;%I" def data;T;'I"def data @data end;T;(To; ; F; ;.;;;I" Csv2hash::DataWrapper#data=;F;[[I" value;T0;[[@i ;F;;4;;;[;{;IC;"QSets the attribute data @param value the value to set the attribute data to. ;T;@;0; F;![;[;"I"QSets the attribute data @param value the value to set the attribute data to.;T;#0;$@;%I"def data=(value);T;'I")def data=(value) @data = value end;T;(To; ; F; ;.;;;I"!Csv2hash::DataWrapper#errors;F;[;[[@i ;F;;9;;;[;{;IC;"*Returns the value of attribute errors ;T;@;0; F;![;[;"I"*Returns the value of attribute errors;T;#0;$@;%I"def errors;T;'I"def errors @errors end;T;(To; ; F; ;.;;;I""Csv2hash::DataWrapper#errors=;F;[[I" value;T0;[[@i ;F;;:;;;[;{;IC;"USets the attribute errors @param value the value to set the attribute errors to. ;T;@$;0; F;![;[;"I"USets the attribute errors @param value the value to set the attribute errors to.;T;#0;$@;%I"def errors=(value);T;'I"-def errors=(value) @errors = value end;T;(To; ; F; ;.;;;I" Csv2hash::DataWrapper#valid;F;[;[[@i ;F;: valid;;;[;{;IC;")Returns the value of attribute valid ;T;@3;0; F;![;[;"I")Returns the value of attribute valid;T;#0;$@;%I"def valid;T;'I"def valid @valid end;T;(To; ; F; ;.;;;I"!Csv2hash::DataWrapper#valid=;F;[[I" value;T0;[[@i ;F;: valid=;;;[;{;IC;"SSets the attribute valid @param value the value to set the attribute valid to. ;T;@@;0; F;![;[;"I"SSets the attribute valid @param value the value to set the attribute valid to.;T;#0;$@;%I"def valid=(value);T;'I"+def valid=(value) @valid = value end;T;(To; ; F; ;.;;;I"%Csv2hash::DataWrapper#initialize;F;[;[[@i ;F;;=;;;[;{;IC;" ;F;@O;0; F;![;[o;> ;?I" return;F;@I""a new instance of DataWrapper;T;0;A[I"DataWrapper;F;@O;"I";T;#0;$@;%I"def initialize;T;&T;'I"Mdef initialize self.valid = true self.data, self.errors = [], [] end;T;(To; ; F; ;.;;;I"!Csv2hash::DataWrapper#valid?;F;[;[[@i;F;;;;;[;{;IC;" ;F;@a;0; F;![;[o;> ;?I" return;F;@I";T;0;A[I" Boolean;T;@a;"I";T;#0;$@;%I"def valid?() valid ; end;T;&T;'I"def valid?() valid ; end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;3IC;Y{;u@;v@;ZT;9IC;Y{;u@;v@$;ZT;IC;Y{;u@3;v@@;ZT;ZT;ZT;[{;\[;[[@i;F;:DataWrapper;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::DataWrapper;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[ o; ;IC;[o; ;IC;[;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[I""lib/csv2hash/adapters/base.rb;Ti ;F;:UnsupportedAdapter;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"0Csv2hash::Adapter::Base::UnsupportedAdapter;F;^o;R ;S0;T0;U0;;_;$@;W0;`;;(To; ; F; ;;;;I"#Csv2hash::Adapter::Base.create;F;[[I"adapter_name;T0[I"file_path_or_data;T0;[[@i ;F;: create;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"4def self.create adapter_name, file_path_or_data;T;&T;'I"def self.create adapter_name, file_path_or_data load "csv2hash/adapters/#{adapter_name}_adapter.rb" class_eval("Csv2hash::Adapter::#{klass_adapter(adapter_name)}").new file_path_or_data end;T;(To; ; F; ;;;M;I"*Csv2hash::Adapter::Base.klass_adapter;F;[[I"adapter_symbol;T0;[[@i;F;:klass_adapter;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"*def self.klass_adapter adapter_symbol;T;&T;'I"def self.klass_adapter adapter_symbol case adapter_symbol when :memory then :MemoryAdapter when :csv then :CsvAdapter else raise UnsupportedAdapter.new end end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: Base;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Adapter::Base;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[o; ; F; ;.;;;I"'Csv2hash::Adapter::Abstract#source;F;[;[[I"&lib/csv2hash/adapters/abstract.rb;Ti ;F;: source;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" raise;F;@I";T;0;A[I"NotImplementedError;T;@;"I";T;#0;$@;%I"def source;T;&T;'I"/def source raise NotImplementedError end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: Abstract;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I" Csv2hash::Adapter::Abstract;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(To; ;IC;[ o; ; F; ;.;;;I",Csv2hash::Adapter::CsvAdapter#file_path;F;[;[[I")lib/csv2hash/adapters/csv_adapter.rb;Ti;F;:file_path;;;[;{;IC;"-Returns the value of attribute file_path ;T;@;0; F;![;[;"I"-Returns the value of attribute file_path;T;#0;$@;%I"def file_path;T;'I"#def file_path @file_path end;T;(To; ; F; ;.;;;I"-Csv2hash::Adapter::CsvAdapter#file_path=;F;[[I" value;T0;[[@i;F;:file_path=;;;[;{;IC;"[Sets the attribute file_path @param value the value to set the attribute file_path to. ;T;@;0; F;![;[;"I"[Sets the attribute file_path @param value the value to set the attribute file_path to.;T;#0;$@;%I"def file_path=(value);T;'I"3def file_path=(value) @file_path = value end;T;(To; ; F; ;.;;;I"-Csv2hash::Adapter::CsvAdapter#initialize;F;[[I"file_path;T0;[[@i;F;;=;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" return;F;@I"!a new instance of CsvAdapter;T;0;A[I"CsvAdapter;F;@;"I";T;#0;$@;%I"def initialize file_path;T;&T;'I">def initialize file_path self.file_path = file_path end;T;(To; ; F; ;.;;;I")Csv2hash::Adapter::CsvAdapter#source;F;[;[[@i;F;;;;;[;{;IC;" ;F;@);0; F;![;[;"I";T;#0;$@;%I"def source;T;&T;'I"-def source CSV.read self.file_path end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;IC;Y{;u@;v@;ZT;ZT;ZT;[{;\[;[[@i ;F;:CsvAdapter;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I""Csv2hash::Adapter::CsvAdapter;F;^o;R ;S0;T0;U0;;;$@;W@;`0;(To; ;IC;[ o; ; F; ;.;;;I"*Csv2hash::Adapter::MemoryAdapter#data;F;[;[[I",lib/csv2hash/adapters/memory_adapter.rb;Ti ;F;;3;;;[;{;IC;"(Returns the value of attribute data ;T;@J;0; F;![;[;"I"(Returns the value of attribute data;T;#0;$@H;%I" def data;T;'I"def data @data end;T;(To; ; F; ;.;;;I"+Csv2hash::Adapter::MemoryAdapter#data=;F;[[I" value;T0;[[@Oi ;F;;4;;;[;{;IC;"QSets the attribute data @param value the value to set the attribute data to. ;T;@X;0; F;![;[;"I"QSets the attribute data @param value the value to set the attribute data to.;T;#0;$@H;%I"def data=(value);T;'I")def data=(value) @data = value end;T;(To; ; F; ;.;;;I"0Csv2hash::Adapter::MemoryAdapter#initialize;F;[[I" data;T0;[[@Oi;F;;=;;;[;{;IC;" ;F;@g;0; F;![;[o;> ;?I" return;F;@I"$a new instance of MemoryAdapter;T;0;A[I"MemoryAdapter;F;@g;"I";T;#0;$@H;%I"def initialize data;T;&T;'I"/def initialize data self.data = data end;T;(To; ; F; ;.;;;I",Csv2hash::Adapter::MemoryAdapter#source;F;[;[[@Oi;F;;;;;[;{;IC;" ;F;@{;0; F;![;[;"I";T;#0;$@H;%I"def source;T;&T;'I"def source self.data end;T;(T;O@H;PIC;[;O@H;QIC;[;O@H;XIC;Y{;IC;Y{;ZT;.IC;Y{;3IC;Y{;u@J;v@X;ZT;ZT;ZT;[{;\[;[[@Oi ;F;:MemoryAdapter;;;;;[;{;IC;" ;F;@H;0; F;![;[;"I";T;#0;$@;I"%Csv2hash::Adapter::MemoryAdapter;F;^o;R ;S0;T0;U0;;;$@;W@;`0;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[ [@i[@i[@i [@Oi ;F;: Adapter;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::Adapter;F;(To; ;IC;[o; ; F; ;.;;;I"$Csv2hash::ExtraValidator#valid?;F;[[I" rule;T0[I" value;T0;[[I"$lib/csv2hash/extra_validator.rb;Ti;F;;;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" return;F;@I";T;0;A[I" Boolean;T;@;"I";T;#0;$@;%I"\def valid?(rule, value) raise 'method parse!() should be implemented in sub class'; end;T;&T;'I"\def valid?(rule, value) raise 'method parse!() should be implemented in sub class'; end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;:ExtraValidator;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I"Csv2hash::ExtraValidator;F;^o;R ;S0;T0;U0;;m;$@;W0;`;;(T@;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i [@i[@i[@i[@i[@ i[@i[@pi[@i[@i[@i[@i[@Hi[@i[@Si[@i [@i [@i[@Oi[@i[@Oi[@i;F;: Csv2hash;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I" Csv2hash;Fo; ;IC;[o; ; F; ;.;;;I"Cell#rules;F;[;[[I"lib/csv2hash/cell.rb;Ti ;F;: rules;;;[;{;IC;")Returns the value of attribute rules ;T;@;0; F;![;[;"I")Returns the value of attribute rules;T;#0;$@;%I"def rules;T;'I"def rules @rules end;T;(To; ; F; ;.;;;I"Cell#rules=;F;[[I" value;T0;[[@i ;F;: rules=;;;[;{;IC;"SSets the attribute rules @param value the value to set the attribute rules to. ;T;@ ;0; F;![;[;"I"SSets the attribute rules @param value the value to set the attribute rules to.;T;#0;$@;%I"def rules=(value);T;'I"+def rules=(value) @rules = value end;T;(To; ; F; ;.;;;I"Cell#initialize;F;[[I" *args;T0;[[@i ;F;;=;;;[;{;IC;" ;F;@;0; F;![;[o;> ;?I" return;F;@I"a new instance of Cell;T;0;A[I" Cell;F;@;"I";T;#0;$@;%I"def initialize *args;T;&T;'I"Bdef initialize *args self.rules = args.extract_options! end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;IC;Y{;u@;v@ ;ZT;ZT;ZT;[{;\[;[[@i;F;: Cell;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I" Cell;F;^o;R ;S0;T0;U0;;m;$@;W0;`;o; ;IC;[o; ; F; ;.;;;I"Registry#initialize;F;[;[[I"lib/csv2hash/registry.rb;Ti;F;;=;;;[;{;IC;" ;F;@C;0; F;![;[o;> ;?I" return;F;@I"a new instance of Registry;T;0;A[I" Registry;F;@C;"I";T;#0;$@A;%I"def initialize;T;&T;'I"1def initialize @definitions = Hash.new end;T;(To; ; F; ;.;;;I"Registry#[];F;[[I" name;T0;[[@Hi ;F;;);;;[;{;IC;" ;F;@V;0; F;![;[;"I";T;#0;$@A;%I"def [] name;T;&T;'I")def [] name @definitions[name] end;T;(To; ; F; ;.;;;I"Registry#[]=;F;[[I" name;T0[I"definition;T0;[[@Hi;F;;*;;;[;{;IC;" ;F;@e;0; F;![;[;"I";T;#0;$@A;%I"def []= name, definition;T;&T;'I"Cdef []= name, definition @definitions[name] = definition end;T;(T;O@A;PIC;[;O@A;QIC;[;O@A;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@Hi;F;: Registry;;;;;[;{;IC;" ;F;@A;0; F;![;[;"I";T;#0;$@;I" Registry;F;^o;R ;S0;T0;U0;;m;$@;W0;`;o; ;IC;[o; ; F; ;.;;;I"CsvArray#to_csv;F;[[I" options;TI"{};T;[[I"lib/csv2hash/csv_array.rb;Ti ;F;: to_csv;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;%I"def to_csv options = {};T;&T;'I"def to_csv options = {} CSV.generate(options) do |csv| self.each do |element| csv << [element[:value], element[:message]] end end end;T;(T;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[[@i;F;: CsvArray;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$@;I" CsvArray;F;^o;R ;S0;T0;U0;: Array;$@;W0;`;;O@;PIC;[;O@;QIC;[;O@;XIC;Y{;IC;Y{;ZT;.IC;Y{;ZT;ZT;[{;\[;[;F;;;;;;;[;{;IC;" ;F;@;0; F;![;[;"I";T;#0;$0;I";T;@:Csv2hash::Main@ :'Csv2hash::Main.generate_definition@ :Csv2hash::Main.[]@:Csv2hash::Main.[]=@-:Csv2hash::Main::@@registry@>:Csv2hash::Main#definition@K:Csv2hash::Main#definition=@X:%Csv2hash::Main#file_path_or_data@g:&Csv2hash::Main#file_path_or_data=@t:Csv2hash::Main#data@~:Csv2hash::Main#data=@:Csv2hash::Main#notifier@:Csv2hash::Main#notifier=@:$Csv2hash::Main#break_on_failure@:%Csv2hash::Main#break_on_failure=@:Csv2hash::Main#errors@:Csv2hash::Main#errors=@:Csv2hash::Main#options@:Csv2hash::Main#options=@:Csv2hash::Main#initialize@ : Csv2hash::Main#init_plugins@":Csv2hash::Main#parse!@/:Csv2hash::Main#parse@<:#Csv2hash::Main#csv_with_errors@I:Csv2hash::Main#data_source@V:$Csv2hash::Main#load_data_source@d:'Csv2hash::Main#dynamic_lib_loading@p;@:Cell#rules@:Cell#rules=@ :Cell#initialize@:Csv2hash::Parser@ :Csv2hash::VERSION@:Csv2hash::Discover@:'Csv2hash::Discover#find_positions!@:Csv2hash::Notifier@:Csv2hash::Notifier#notify@;@A:Registry#initialize@C:Registry#[]@V:Registry#[]=@e;@:CsvArray#to_csv@:Csv2hash::Validator@:'Csv2hash::Validator#validate_rules@:Csv2hash::Validator#valid?@:&Csv2hash::Validator#validate_cell@&: Csv2hash::Validator#message@9:Csv2hash::Definition@:"Csv2hash::Definition::MAPPING@:%Csv2hash::Definition::COLLECTION@: Csv2hash::Definition::TYPES@:Csv2hash::Definition#cells@: Csv2hash::Definition#cells=@:)Csv2hash::Definition#structure_rules@:*Csv2hash::Definition#structure_rules=@:%Csv2hash::Definition#header_size@":&Csv2hash::Definition#header_size=@/:Csv2hash::Definition#type@>:Csv2hash::Definition#name@K:$Csv2hash::Definition#initialize@X:!Csv2hash::Definition#mapping@n:Csv2hash::Definition#cell@}:)Csv2hash::Definition#set_header_size@:"Csv2hash::Definition#set_type@:-Csv2hash::Definition#set_structure_rules@:#Csv2hash::Definition#validate!@:"Csv2hash::Definition#default!@:*Csv2hash::Definition#default_position@:Csv2hash::Expectation@e:+Csv2hash::Expectation#unexpected_line?@g:Csv2hash::DataWrapper@:Csv2hash::DataWrapper#data@: Csv2hash::DataWrapper#data=@:!Csv2hash::DataWrapper#errors@:"Csv2hash::DataWrapper#errors=@$: Csv2hash::DataWrapper#valid@3:!Csv2hash::DataWrapper#valid=@@:%Csv2hash::DataWrapper#initialize@O:!Csv2hash::DataWrapper#valid?@a:Csv2hash::Adapter@:Csv2hash::Adapter::Base@:0Csv2hash::Adapter::Base::UnsupportedAdapter@:#Csv2hash::Adapter::Base.create@:*Csv2hash::Adapter::Base.klass_adapter@:Csv2hash::Parser::Mapping@:$Csv2hash::Parser::Mapping#fill!@:&Csv2hash::Parser::Mapping#fill_it@:Csv2hash::ExtraValidator@:$Csv2hash::ExtraValidator#valid?@:!Csv2hash::Parser::Collection@A:'Csv2hash::Parser::Collection#fill!@C:)Csv2hash::Parser::Collection#fill_it@Q: Csv2hash::Adapter::Abstract@:'Csv2hash::Adapter::Abstract#source@:!Csv2hash::Validator::Mapping@L:0Csv2hash::Validator::Mapping#validate_data!@N:*Csv2hash::Validator::Mapping#position@\:!Csv2hash::StructureValidator@:2Csv2hash::StructureValidator::ValidationError@:-Csv2hash::StructureValidator::MAX_COLUMN@:-Csv2hash::StructureValidator::MIN_COLUMN@:-Csv2hash::StructureValidator::RULES_NAME@:5Csv2hash::StructureValidator#validate_structure!@:/Csv2hash::StructureValidator#rule_instance@:,Csv2hash::StructureValidator::Validator@:6Csv2hash::StructureValidator::Validator#validate!@:"Csv2hash::Adapter::CsvAdapter@:,Csv2hash::Adapter::CsvAdapter#file_path@:-Csv2hash::Adapter::CsvAdapter#file_path=@:-Csv2hash::Adapter::CsvAdapter#initialize@:)Csv2hash::Adapter::CsvAdapter#source@):$Csv2hash::Validator::Collection@|:3Csv2hash::Validator::Collection#validate_data!@~:-Csv2hash::Validator::Collection#position@:%Csv2hash::Adapter::MemoryAdapter@H:*Csv2hash::Adapter::MemoryAdapter#data@J:+Csv2hash::Adapter::MemoryAdapter#data=@X:0Csv2hash::Adapter::MemoryAdapter#initialize@g:,Csv2hash::Adapter::MemoryAdapter#source@{:-Csv2hash::StructureValidator::MaxColumns@:8Csv2hash::StructureValidator::MaxColumns#initialize@:;Csv2hash::StructureValidator::MaxColumns#validate_line@:;Csv2hash::StructureValidator::MaxColumns#error_message@%:-Csv2hash::StructureValidator::MinColumns@F:8Csv2hash::StructureValidator::MinColumns#initialize@H:;Csv2hash::StructureValidator::MinColumns#validate_line@]:;Csv2hash::StructureValidator::MinColumns#error_message@l:.Csv2hash::StructureValidator::Deprecation@:>Csv2hash::StructureValidator::Deprecation::OLD_MAX_COLUMN@:>Csv2hash::StructureValidator::Deprecation::OLD_MIN_COLUMN@:>Csv2hash::StructureValidator::Deprecation::OLD_RULES_NAME@::Csv2hash::StructureValidator::Deprecation::NEW_SYNTAX@:;Csv2hash::StructureValidator::Deprecation#check_params@