Commit fa341a0

mokha <mokha@cisco.com>
2019-01-08 16:52:32
extract attribute class
1 parent 0b7b891
Changed files (1)
lib
scim
lib/scim/kit/v2/attributable.rb
@@ -9,10 +9,7 @@ module Scim
 
         def define_attributes_for(types)
           @dynamic_attributes = {}.with_indifferent_access
-          types.each do |type|
-            dynamic_attributes[type.name] = Attribute.new(type: type)
-            extend(create_module_for(type))
-          end
+          types.each { |x| attribute(x) }
         end
 
         private
@@ -44,6 +41,11 @@ module Scim
             end
           end
         end
+
+        def attribute(type)
+          dynamic_attributes[type.name] = Attribute.new(type: type)
+          extend(create_module_for(type))
+        end
       end
     end
   end