Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/plumbing/object.rb
Instance Method Summary collapse
-
#as(interface) ⇒ Object
Validate that this object satisfies the given literal interface/type and return self.
Instance Method Details
#as(interface) ⇒ Object
Validate that this object satisfies the given literal interface/type and return self. No narrowing proxy — validate-and-passthrough (the v1 replacement for the old RubberDuck cast).
7 8 9 10 |
# File 'lib/plumbing/object.rb', line 7 def as(interface) Literal.check(self, interface) # check(value, type) — raises Literal::TypeError on mismatch self end |