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.



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

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

Instance Attribute Details

#fieldnameObject (readonly)

Returns the value of attribute fieldname.



339
340
341
# File 'lib/ar-extensions/extensions.rb', line 339

def fieldname
  @fieldname
end

#negateObject (readonly)

Returns the value of attribute negate.



339
340
341
# File 'lib/ar-extensions/extensions.rb', line 339

def negate
  @negate
end

Instance Method Details

#negate?Boolean

Returns:

  • (Boolean)


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

def negate?
  negate ? true : false
end