From 11303a4d6664d9a7ff7bc408035d2ab70378a375 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sat, 26 Nov 2011 13:20:57 +0900 Subject: adding in support for ruby 1.9.3 release version 1.0.9 --- doc/Axlsx/DataTypeValidator.html | 77 ++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 43 deletions(-) (limited to 'doc/Axlsx/DataTypeValidator.html') diff --git a/doc/Axlsx/DataTypeValidator.html b/doc/Axlsx/DataTypeValidator.html index b74915de..51a6b741 100644 --- a/doc/Axlsx/DataTypeValidator.html +++ b/doc/Axlsx/DataTypeValidator.html @@ -6,7 +6,7 @@ Class: Axlsx::DataTypeValidator - — Documentation by YARD 0.7.3 + — AXLSX @@ -94,11 +94,10 @@

Overview

-

-Validate that the class of the value provided is either an instance or the + +

Validate that the class of the value provided is either an instance or the class of the allowed types and that any specified additional validation -returns true. -

+returns true.

@@ -122,7 +121,7 @@ returns true.
  • - + (Boolean) validate(name, types, v, other = lambda{|v| true }) + + (Boolean) validate(name, types, v, other = lambda{|arg| true }) @@ -135,9 +134,8 @@ returns true. -

    -Perform validation. -

    +
    +

    Perform validation.

  • @@ -155,15 +153,14 @@ Perform validation.

    - + (Boolean) validate(name, types, v, other = lambda{|v| true }) + + (Boolean) validate(name, types, v, other = lambda{|arg| true })

    -

    -Perform validation -

    + +

    Perform validation

    @@ -182,9 +179,8 @@ Perform validation — -

    -The name of what is being validated. This is included in the error message -

    +
    +

    The name of what is being validated. This is included in the error message

    @@ -199,9 +195,8 @@ The name of what is being validated. This is included in the error message — -

    -A single class or array of classes that the value is validated against. -

    +
    +

    A single class or array of classes that the value is validated against.

    @@ -214,13 +209,12 @@ A single class or array of classes that the value is validated against. (Block) - (defaults to: lambda{|v| true }) + (defaults to: lambda{|arg| true }) — -

    -Any block that must evaluate to true for the value to be valid -

    +
    +

    Any block that must evaluate to true for the value to be valid

    @@ -238,9 +232,8 @@ Any block that must evaluate to true for the value to be valid — -

    -true if validation succeeds. -

    +
    +

    true if validation succeeds.

    @@ -257,10 +250,9 @@ true if validation succeeds. — -

    -Raised if the class of the value provided is not in the specified array of -types or the block passed returns false -

    +
    +

    Raised if the class of the value provided is not in the specified array of +types or the block passed returns false

    @@ -294,17 +286,16 @@ types or the block passed returns false
    # File 'lib/axlsx/util/validators.rb', line 34
     
    -def self.validate(name, types, v, other= lambda{|v| true })
    -  types = [types] unless types.is_a? Array
    -  valid_type = false
    -  if v.class == Class
    -    types.each { |t| valid_type = true if v.ancestors.include?(t) }
    -  else
    -    types.each { |t| valid_type = true if v.is_a?(t) }
    -  end
    -  raise ArgumentError, (ERR_TYPE % [v.inspect, name, types.inspect]) unless (other.call(v) && valid_type)
    -end
    -
    +def self.validate(name, types, v, other= lambda{|arg| true }) + types = [types] unless types.is_a? Array + valid_type = false + if v.class == Class + types.each { |t| valid_type = true if v.ancestors.include?(t) } + else + types.each { |t| valid_type = true if v.is_a?(t) } + end + raise ArgumentError, (ERR_TYPE % [v.inspect, name, types.inspect]) unless (other.call(v) && valid_type) +end @@ -315,9 +306,9 @@ types or the block passed returns false
    -- cgit v1.2.3