class ServiceOperation::Params::Any

Matches any sub type

Attributes

sub_types[R]

Public Class Methods

new(sub_types) click to toggle source
Calls superclass method ServiceOperation::Params::EnumType::new
# File lib/service_operation/params/types.rb, line 54
def initialize(sub_types)
  @sub_types = Array(sub_types)
  super
end

Public Instance Methods

===(other) click to toggle source

@return [Boolean]

# File lib/service_operation/params/types.rb, line 60
def ===(other)
  sub_types.any? { |sv| sv === other }
end
name() click to toggle source

@return [String] representation of class and its sub classes

# File lib/service_operation/params/types.rb, line 65
def name
  "Any(#{sub_types.map(&:name).join(', ')})"
end