Class: Dynamoid::Criteria::IgnoredConditionsDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/criteria/ignored_conditions_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(conditions) ⇒ IgnoredConditionsDetector

Returns a new instance of IgnoredConditionsDetector.


7
8
9
10
# File 'lib/dynamoid/criteria/ignored_conditions_detector.rb', line 7

def initialize(conditions)
  @conditions = conditions
  @ignored_keys = ignored_keys
end

Instance Method Details

#found?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/dynamoid/criteria/ignored_conditions_detector.rb', line 12

def found?
  @ignored_keys.present?
end

#warning_messageObject


16
17
18
19
20
21
# File 'lib/dynamoid/criteria/ignored_conditions_detector.rb', line 16

def warning_message
  return unless found?

  'Where conditions may contain only one condition for an attribute. ' \
    "Following conditions are ignored: #{ignored_conditions}"
end