class Fried::Typings::OneOf
Checks if the object {#is_a?} object of the passed types
Attributes
types[R]
Public Class Methods
new(*types)
click to toggle source
# File lib/fried/typings/one_of.rb, line 18 def initialize(*types) @types = types end
Public Instance Methods
valid?(obj)
click to toggle source
# File lib/fried/typings/one_of.rb, line 22 def valid?(obj) types.any? do |type| Is[type].valid?(obj) end end