Class: Typespec::Value

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

Overview

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Value

Returns a new instance of Value.



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

def initialize(value); @value = value; end

Class Method Details

.[](value) ⇒ Object



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

def self.[](value); self.new(value); end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


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

def valid?(value) value.eql?(@value); end