Class: Typeguard::Validation::Literal
- Defined in:
- lib/typeguard/types.rb
Instance Method Summary collapse
-
#initialize(node) ⇒ Literal
constructor
A new instance of Literal.
- #valid?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(node) ⇒ Literal
Returns a new instance of Literal.
136 137 138 |
# File 'lib/typeguard/types.rb', line 136 def initialize(node) @expected = node.kind.to_s end |
Instance Method Details
#valid?(value) ⇒ Boolean
140 141 142 |
# File 'lib/typeguard/types.rb', line 140 def valid?(value) value.to_s == @expected end |