Class: Typeguard::Validation::Basic

Inherits:
Base
  • Object
show all
Defined in:
lib/typeguard/types.rb

Instance Method Summary collapse

Methods inherited from Base

from

Constructor Details

#initialize(node) ⇒ Basic

Returns a new instance of Basic.



41
42
43
# File 'lib/typeguard/types.rb', line 41

def initialize(node)
  @klass = node.[:const]
end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/typeguard/types.rb', line 45

def valid?(value)
  value.is_a?(@klass)
end