lib/eco/api/common/loaders/parser.rb in eco-helpers-1.5.14 vs lib/eco/api/common/loaders/parser.rb in eco-helpers-1.5.15

- old
+ new

@@ -58,10 +58,12 @@ keys = data_keys(source_data) attrs.all? {|key| keys.include?(key)} end end + private + # Helper to obtain the current internal named attributes of the data # @param source_data [Array<String>, Hash] if `Array` those are already the `keys`, if `Hash` it gets the `keys` # @return [Array<String>] `keys` of `source_data` def data_keys(source_data) case source_data @@ -73,9 +75,11 @@ keys = [] end end end + + inheritable_class_vars :attribute def initialize(person_parser) raise "Expected Eco::API::Common::People::PersonParser. Given #{policies.class}" unless person_parser.is_a?(Eco::API::Common::People::PersonParser) person_parser.define_attribute(self.attribute, dependencies: self.class.dependencies) do |attr_parser| _define_parser(attr_parser)