Class: Ardb::RecordSpy::Validation

Inherits:
Object
  • Object
show all
Defined in:
lib/ardb/record_spy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, *args, &block) ⇒ Validation

Returns a new instance of Validation.



217
218
219
220
221
222
223
# File 'lib/ardb/record_spy.rb', line 217

def initialize(type, *args, &block)
  @type = type.to_sym
  @options = args.last.is_a?(::Hash) ? args.pop : {}
  @args = args
  @block = block
  @method_name = @args.first if @type == :custom
end

Instance Attribute Details

#argsObject (readonly) Also known as: columns, associations, classes

Returns the value of attribute args.



212
213
214
# File 'lib/ardb/record_spy.rb', line 212

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



212
213
214
# File 'lib/ardb/record_spy.rb', line 212

def block
  @block
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



212
213
214
# File 'lib/ardb/record_spy.rb', line 212

def method_name
  @method_name
end

#optionsObject (readonly)

Returns the value of attribute options.



212
213
214
# File 'lib/ardb/record_spy.rb', line 212

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



212
213
214
# File 'lib/ardb/record_spy.rb', line 212

def type
  @type
end