lib/grape_entity/exposure/base.rb in grape-entity-0.7.0 vs lib/grape_entity/exposure/base.rb in grape-entity-0.7.1

- old
+ new

@@ -2,11 +2,11 @@ module Grape class Entity module Exposure class Base - attr_reader :attribute, :is_safe, :documentation, :conditions, :for_merge + attr_reader :attribute, :is_safe, :documentation, :override, :conditions, :for_merge def self.new(attribute, options, conditions, *args, &block) super(attribute, options, conditions).tap { |e| e.setup(*args, &block) } end @@ -17,10 +17,11 @@ @key = key.respond_to?(:to_sym) ? key.to_sym : key @is_safe = options[:safe] @for_merge = options[:merge] @attr_path_proc = options[:attr_path] @documentation = options[:documentation] + @override = options[:override] @conditions = conditions end def dup(&block) self.class.new(*dup_args, &block) @@ -114,11 +115,11 @@ options.with_attr_path(path_part) do yield end end - def replaceable_by?(other) - !nesting? && !conditional? && !other.nesting? && !other.conditional? + def override? + @override end protected attr_reader :options