class DataMapper::Query::Conditions::NullOperation

Public Class Methods

new() click to toggle source

Initialize a NullOperation

@return [NullOperation]

the operation

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 714
def initialize
  @operands = Set.new
end

Public Instance Methods

inspect() click to toggle source

Inspecting the operation should return the same as nil

@return [String]

return the string 'nil'

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 702
def inspect
  'nil'
end
matches?(record) click to toggle source

Match the record

A NullOperation matches every record.

@param [Resource, Hash] record

the resource to match

@return [true]

every record matches

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 670
def matches?(record)
  record.kind_of?(Hash) || record.kind_of?(Resource)
end
nil?() click to toggle source

Treat the operation the same as nil

@return [true]

should be treated as nil

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 692
def nil?
  true
end
valid?() click to toggle source

Test validity of the operation

A NullOperation is always valid.

@return [true]

always valid

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 682
def valid?
  true
end