Class: ActiveRecord::Extensions::RegexpBase::RegexpResult

Inherits:
Object
  • Object
show all
Defined in:
lib/ar-extensions/extensions.rb

Overview

A result class which provides an easy interface.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fieldname, negate = false) ⇒ RegexpResult

Returns a new instance of RegexpResult.



343
344
345
# File 'lib/ar-extensions/extensions.rb', line 343

def initialize( fieldname, negate=false )
  @fieldname, @negate = fieldname, negate
end

Instance Attribute Details

#fieldnameObject (readonly)

Returns the value of attribute fieldname.



341
342
343
# File 'lib/ar-extensions/extensions.rb', line 341

def fieldname
  @fieldname
end

#negateObject (readonly)

Returns the value of attribute negate.



341
342
343
# File 'lib/ar-extensions/extensions.rb', line 341

def negate
  @negate
end

Instance Method Details

#negate?Boolean

Returns:

  • (Boolean)


347
348
349
# File 'lib/ar-extensions/extensions.rb', line 347

def negate?
  negate ? true : false
end