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.



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

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

Instance Attribute Details

#fieldnameObject (readonly)

Returns the value of attribute fieldname.



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

def fieldname
  @fieldname
end

#negateObject (readonly)

Returns the value of attribute negate.



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

def negate
  @negate
end

Instance Method Details

#negate?Boolean

Returns:

  • (Boolean)


352
353
354
# File 'lib/ar-extensions/extensions.rb', line 352

def negate?
  negate ? true : false
end