Class: Ardb::RecordSpy::Validation
- Inherits:
-
Object
- Object
- Ardb::RecordSpy::Validation
- Defined in:
- lib/ardb/record_spy.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
(also: #columns, #associations, #classes)
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, *args, &block) ⇒ Validation
constructor
A new instance of Validation.
Constructor Details
#initialize(type, *args, &block) ⇒ Validation
Returns a new instance of Validation.
228 229 230 231 232 233 234 235 236 |
# File 'lib/ardb/record_spy.rb', line 228 def initialize(type, *args, &block) @type = type.to_sym @options = args.last.kind_of?(::Hash) ? args.pop : {} @args = args @block = block if @type == :custom @method_name = @args.first end end |
Instance Attribute Details
#args ⇒ Object (readonly) Also known as: columns, associations, classes
Returns the value of attribute args.
223 224 225 |
# File 'lib/ardb/record_spy.rb', line 223 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
223 224 225 |
# File 'lib/ardb/record_spy.rb', line 223 def block @block end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
223 224 225 |
# File 'lib/ardb/record_spy.rb', line 223 def method_name @method_name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
223 224 225 |
# File 'lib/ardb/record_spy.rb', line 223 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
223 224 225 |
# File 'lib/ardb/record_spy.rb', line 223 def type @type end |