class Grape::Entity::Condition::HashCondition
Attributes
cond_hash[R]
Public Instance Methods
==(other)
click to toggle source
Calls superclass method
Grape::Entity::Condition::Base#==
# File lib/grape_entity/condition/hash_condition.rb, line 12 def ==(other) super && @cond_hash == other.cond_hash end
if_value(_entity, options)
click to toggle source
# File lib/grape_entity/condition/hash_condition.rb, line 16 def if_value(_entity, options) @cond_hash.all? { |k, v| options[k.to_sym] == v } end
setup(cond_hash)
click to toggle source
# File lib/grape_entity/condition/hash_condition.rb, line 8 def setup(cond_hash) @cond_hash = cond_hash end
unless_value(_entity, options)
click to toggle source
# File lib/grape_entity/condition/hash_condition.rb, line 20 def unless_value(_entity, options) @cond_hash.any? { |k, v| options[k.to_sym] != v } end