lib/yaks/mapper.rb in yaks-0.7.6 vs lib/yaks/mapper.rb in yaks-0.7.7

- old
+ new

@@ -4,11 +4,11 @@ class Mapper extend ClassMethods, Forwardable include Util, FP, FP::Callable def_delegators 'self.class', :config - def_delegators :config, :attributes, :links, :associations, :controls + def_delegators :config, :attributes, :links, :associations, :forms config Config.new attr_reader :object, :context @@ -42,11 +42,11 @@ return NullResource.new if object.nil? [ :map_attributes, :map_links, :map_subresources, - :map_controls + :map_forms ].inject(Resource.new(type: mapper_name)) do |resource, method| send(method, resource) end end @@ -98,12 +98,12 @@ associations.inject(resource) do |res, association| association.add_to_resource(res, self, context) end end - def map_controls(resource) - controls.inject(resource) do |res, control| - control.add_to_resource(res, self, context) + def map_forms(resource) + forms.inject(resource) do |res, form| + form.add_to_resource(res, self, context) end end end end