class ActiveHash::Relation::Conditions

Attributes

conditions[R]

Public Class Methods

new(conditions = []) click to toggle source
# File lib/active_hash/conditions.rb, line 6
def initialize(conditions = [])
  @conditions = conditions
end
wrap(conditions) click to toggle source
# File lib/active_hash/conditions.rb, line 16
def self.wrap(conditions)
  return conditions if conditions.is_a?(self)

  new(conditions)
end

Public Instance Methods

matches?(record) click to toggle source
# File lib/active_hash/conditions.rb, line 10
def matches?(record)
  conditions.all? do |condition|
    condition.matches?(record)
  end
end