Class: Typeguard::Validation::Duck
Instance Method Summary collapse
-
#initialize(node) ⇒ Duck
constructor
A new instance of Duck.
- #valid?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(node) ⇒ Duck
Returns a new instance of Duck.
152 153 154 |
# File 'lib/typeguard/types.rb', line 152 def initialize(node) @name = node.kind[1..] end |
Instance Method Details
#valid?(value) ⇒ Boolean
156 157 158 |
# File 'lib/typeguard/types.rb', line 156 def valid?(value) value.respond_to?(@name) end |