Class: Validate::AST::Rules::Pending
Instance Method Summary
collapse
Methods inherited from Constraint
create_class, inherited
Constructor Details
#initialize(name, args, block, caller) ⇒ Pending
Returns a new instance of Pending.
194
195
196
197
198
199
200
201
202
203
|
# File 'lib/validate/ast.rb', line 194
def initialize(name, args, block, caller)
@name = name
@args = args
@block = block
@caller = caller
@constraint = nil
extend SingleForwardable
mon_initialize
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
225
226
227
|
# File 'lib/validate/ast.rb', line 225
def method_missing(method, *args)
load_constraint { return NameError }.__send__(method, *args)
end
|
Instance Method Details
#==(other) ⇒ Object
221
222
223
|
# File 'lib/validate/ast.rb', line 221
def ==(other)
load_constraint { return false } == other
end
|
#inspect ⇒ Object
217
218
219
|
# File 'lib/validate/ast.rb', line 217
def inspect
load_constraint { return "[pending #{@name}]" }.inspect
end
|
#name ⇒ Object
205
206
207
|
# File 'lib/validate/ast.rb', line 205
def name
load_constraint { return @name }.name
end
|
#respond_to_missing?(method, pvt = false) ⇒ Boolean
229
230
231
|
# File 'lib/validate/ast.rb', line 229
def respond_to_missing?(method, pvt = false)
load_constraint { return false }.__send__(:respond_to_missing?, method, pvt)
end
|
#to_s ⇒ Object
213
214
215
|
# File 'lib/validate/ast.rb', line 213
def to_s
load_constraint { return "[pending #{@name}]" }.to_s
end
|
#valid?(value, ctx = Constraints::ValidationContext.none) ⇒ Boolean
209
210
211
|
# File 'lib/validate/ast.rb', line 209
def valid?(value, ctx = Constraints::ValidationContext.none)
load_constraint { throw(:pending, true) }.valid?(value, ctx)
end
|