Class: Typespec::Enum

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

Overview

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*can_take_on) ⇒ Enum

Returns a new instance of Enum.



179
# File 'lib/typespec.rb', line 179

def initialize(*can_take_on) @can_take_on = can_take_on end

Class Method Details

.[](*can_take_on) ⇒ Object



180
# File 'lib/typespec.rb', line 180

def self.[](*can_take_on); Typespec::Enum.new(*can_take_on); end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


181
# File 'lib/typespec.rb', line 181

def valid?(value) @can_take_on.include?(value); end