lib/grape_entity/exposure/base.rb in grape-entity-0.5.0 vs lib/grape_entity/exposure/base.rb in grape-entity-0.5.1

- old
+ new

@@ -1,19 +1,20 @@ module Grape class Entity module Exposure class Base - attr_reader :attribute, :key, :is_safe, :documentation, :conditions + attr_reader :attribute, :key, :is_safe, :documentation, :conditions, :for_merge def self.new(attribute, options, conditions, *args, &block) super(attribute, options, conditions).tap { |e| e.setup(*args, &block) } end def initialize(attribute, options, conditions) @attribute = attribute.try(:to_sym) @options = options @key = (options[:as] || attribute).try(:to_sym) @is_safe = options[:safe] + @for_merge = options[:merge] @attr_path_proc = options[:attr_path] @documentation = options[:documentation] @conditions = conditions end