Class: Esbuild::Flags::OneOf
- Inherits:
-
Object
- Object
- Esbuild::Flags::OneOf
- Defined in:
- lib/esbuild/flags.rb
Class Method Summary collapse
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(*classes) ⇒ OneOf
constructor
A new instance of OneOf.
- #to_s ⇒ Object
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_s ⇒ Object
14 15 16 |
# File 'lib/esbuild/flags.rb', line 14 def to_s @classes.join(" or ") end |