Class: Esbuild::Flags::OneOf

Inherits:
Object
  • Object
show all
Defined in:
lib/esbuild/flags.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*classes) ⇒ OneOf

Returns a new instance of OneOf.



6
7
8
# File 'lib/esbuild/flags.rb', line 6

def initialize(*classes)
  @classes = classes
end

Class Method Details

.[](*classes) ⇒ Object



18
19
20
# File 'lib/esbuild/flags.rb', line 18

def self.[](*classes)
  new(*classes)
end

Instance Method Details

#===(other) ⇒ Object



10
11
12
# File 'lib/esbuild/flags.rb', line 10

def ===(other)
  @classes.any? { |klass| klass === other }
end

#to_sObject



14
15
16
# File 'lib/esbuild/flags.rb', line 14

def to_s
  @classes.join(" or ")
end